From: Richard Smith Date: Tue, 17 Sep 2019 03:56:28 +0000 (+0000) Subject: Fix reliance on lax vector conversions in tests for x86 intrinsics. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f149feb71fefb01ce47ad093cdc7881244899a16;p=clang Fix reliance on lax vector conversions in tests for x86 intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372062 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/const-init.c b/test/CodeGen/const-init.c index 41ac8f2eb0..374aa00e65 100644 --- a/test/CodeGen/const-init.c +++ b/test/CodeGen/const-init.c @@ -141,8 +141,8 @@ void g28() { // CHECK: @g28.b = internal global <12 x i16> // CHECK: @g28.c = internal global <2 x x86_fp80> , align 32 static v1i64 a = (v1i64)10LL; - static v12i16 b = (v2f80){1,2}; - static v2f80 c = (v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0}; + static v12i16 b = (v12i16)(v2f80){1,2}; + static v2f80 c = (v2f80)(v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0}; } // PR13643 diff --git a/test/CodeGen/ppc-smmintrin.c b/test/CodeGen/ppc-smmintrin.c index e11656225a..666bc0fc44 100644 --- a/test/CodeGen/ppc-smmintrin.c +++ b/test/CodeGen/ppc-smmintrin.c @@ -15,7 +15,7 @@ test_extract() { _mm_extract_epi8(mi, 0); _mm_extract_epi32(mi, 0); _mm_extract_epi64(mi, 0); - _mm_extract_ps(mi, 0); + _mm_extract_ps((__m128)mi, 0); } // CHECK-LABEL: @test_extract diff --git a/test/CodeGen/sse-builtins.c b/test/CodeGen/sse-builtins.c index b68a714b43..3891c076fa 100644 --- a/test/CodeGen/sse-builtins.c +++ b/test/CodeGen/sse-builtins.c @@ -714,7 +714,7 @@ void test_mm_storeu_ps(float* x, __m128 y) { _mm_storeu_ps(x, y); } -void test_mm_stream_ps(float*A, __m128d B) { +void test_mm_stream_ps(float*A, __m128 B) { // CHECK-LABEL: test_mm_stream_ps // CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 16, !nontemporal _mm_stream_ps(A, B); diff --git a/test/CodeGen/sse.c b/test/CodeGen/sse.c index 1191f55f81..a75b8dc77e 100644 --- a/test/CodeGen/sse.c +++ b/test/CodeGen/sse.c @@ -5,37 +5,37 @@ #include // Byte-shifts look reversed due to xmm register layout -__m128 test_mm_slli_si128(__m128 a) { +__m128i test_mm_slli_si128(__m128i a) { // CHECK-LABEL: @test_mm_slli_si128 // CHECK: shufflevector <16 x i8> <{{.*}}, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x i8> {{.*}}, <16 x i32> return _mm_slli_si128(a, 5); } -__m128 test_mm_slli_si128_0(__m128 a) { +__m128i test_mm_slli_si128_0(__m128i a) { // CHECK-LABEL: @test_mm_slli_si128_0 // CHECK-NOT: shufflevector return _mm_slli_si128(a, 0); } -__m128 test_mm_slli_si128_16(__m128 a) { +__m128i test_mm_slli_si128_16(__m128i a) { // CHECK-LABEL: @test_mm_slli_si128_16 // CHECK-NOT: shufflevector return _mm_slli_si128(a, 16); } -__m128 test_mm_srli_si128(__m128 a) { +__m128i test_mm_srli_si128(__m128i a) { // CHECK-LABEL: @test_mm_srli_si128 // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> , <16 x i32> return _mm_srli_si128(a, 5); } -__m128 test_mm_srli_si128_0(__m128 a) { +__m128i test_mm_srli_si128_0(__m128i a) { // CHECK-LABEL: @test_mm_srli_si128_0 // CHECK-NOT: shufflevector return _mm_srli_si128(a, 0); } -__m128 test_mm_srli_si128_16(__m128 a) { +__m128i test_mm_srli_si128_16(__m128i a) { // CHECK-LABEL: @test_mm_srli_si128_16 // CHECK-NOT: shufflevector return _mm_srli_si128(a, 16); diff --git a/test/CodeGen/target-builtin-error.c b/test/CodeGen/target-builtin-error.c index ee41277706..4e44b7208a 100644 --- a/test/CodeGen/target-builtin-error.c +++ b/test/CodeGen/target-builtin-error.c @@ -3,6 +3,6 @@ #include -__m128d foo(__m128d a, __m128d b) { +__m128 foo(__m128 a, __m128 b) { return __builtin_ia32_addsubps(b, a); // expected-error {{'__builtin_ia32_addsubps' needs target feature sse3}} } diff --git a/test/CodeGen/x86-builtins-vector-width.c b/test/CodeGen/x86-builtins-vector-width.c index 62f5929e4f..dca3e5874e 100644 --- a/test/CodeGen/x86-builtins-vector-width.c +++ b/test/CodeGen/x86-builtins-vector-width.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple i686-linux-gnu -target-cpu i686 -emit-llvm %s -o - | FileCheck %s -typedef signed long long V2LLi __attribute__((vector_size(16))); -typedef signed long long V4LLi __attribute__((vector_size(32))); +typedef double V2LLi __attribute__((vector_size(16))); +typedef double V4LLi __attribute__((vector_size(32))); // Make sure builtin forces a min-legal-width attribute void foo(void) { diff --git a/test/Headers/xmmintrin.c b/test/Headers/xmmintrin.c index c617504b85..9b8993e6bb 100644 --- a/test/Headers/xmmintrin.c +++ b/test/Headers/xmmintrin.c @@ -22,7 +22,7 @@ __m64 test_mm_cvtps_pi16(__m128 a) { // Make sure that including also makes 's content available. // This is an ugly hack for GCC compatibility. -__m128 test_xmmintrin_provides_emmintrin(__m128d __a, __m128d __b) { +__m128d test_xmmintrin_provides_emmintrin(__m128d __a, __m128d __b) { return _mm_add_sd(__a, __b); } diff --git a/test/Sema/builtins-x86.c b/test/Sema/builtins-x86.c index dca0bdc720..a00044f85d 100644 --- a/test/Sema/builtins-x86.c +++ b/test/Sema/builtins-x86.c @@ -37,7 +37,7 @@ __m128d test__builtin_ia32_cmpsd(__m128d __a, __m128d __b) { return __builtin_ia32_cmpsd(__a, __b, 32); // expected-error {{argument value 32 is outside the valid range [0, 31]}} } -__mmask16 test__builtin_ia32_cmpps512_mask(__m512d __a, __m512d __b) { +__mmask16 test__builtin_ia32_cmpps512_mask(__m512 __a, __m512 __b) { return __builtin_ia32_cmpps512_mask(__a, __b, 32, -1, 4); // expected-error {{argument value 32 is outside the valid range [0, 31]}} }