Skip to content

Commit 2c176f2

Browse files
committed
[X86][AVX] Add i386 test coverage to avx intrinsic tests
1 parent d727505 commit 2c176f2

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

clang/test/CodeGen/X86/avx-builtins-constrained-cmp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -ffp-exception-behavior=maytrap -o - -Wall -Werror | FileCheck %s
2+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx -emit-llvm -ffp-exception-behavior=maytrap -o - -Wall -Werror | FileCheck %s
23

34
// Test that the constrained intrinsics are picking up the exception
45
// metadata from the AST instead of the global default from the command line.

clang/test/CodeGen/X86/avx-builtins.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s
2-
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
3-
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s
1+
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X64
2+
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X64
3+
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X86
4+
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X86
5+
// RUN: %clang_cc1 -no-opaque-pointers -flax-vector-conversions=none -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X64
46

57

68
#include <immintrin.h>
@@ -1081,8 +1083,8 @@ int test_mm256_extract_epi32(__m256i A) {
10811083

10821084
#if __x86_64__
10831085
long long test_mm256_extract_epi64(__m256i A) {
1084-
// CHECK-LABEL: test_mm256_extract_epi64
1085-
// CHECK: extractelement <4 x i64> %{{.*}}, {{i32|i64}} 3
1086+
// X64-LABEL: test_mm256_extract_epi64
1087+
// X64: extractelement <4 x i64> %{{.*}}, {{i32|i64}} 3
10861088
return _mm256_extract_epi64(A, 3);
10871089
}
10881090
#endif
@@ -1161,8 +1163,8 @@ __m256i test_mm256_insert_epi32(__m256i x, int b) {
11611163

11621164
#if __x86_64__
11631165
__m256i test_mm256_insert_epi64(__m256i x, long long b) {
1164-
// CHECK-LABEL: test_mm256_insert_epi64
1165-
// CHECK: insertelement <4 x i64> %{{.*}}, i64 %{{.*}}, {{i32|i64}} 2
1166+
// X64-LABEL: test_mm256_insert_epi64
1167+
// X64: insertelement <4 x i64> %{{.*}}, i64 %{{.*}}, {{i32|i64}} 2
11661168
return _mm256_insert_epi64(x, b, 2);
11671169
}
11681170
#endif
@@ -2056,20 +2058,29 @@ int test_mm256_testz_si256(__m256i A, __m256i B) {
20562058
}
20572059

20582060
__m256 test_mm256_undefined_ps(void) {
2059-
// CHECK-LABEL: test_mm256_undefined_ps
2060-
// CHECK: ret <8 x float> zeroinitializer
2061+
// X64-LABEL: test_mm256_undefined_ps
2062+
// X64: ret <8 x float> zeroinitializer
2063+
//
2064+
// X86-LABEL: test_mm256_undefined_ps
2065+
// X86: store <8 x float> zeroinitializer
20612066
return _mm256_undefined_ps();
20622067
}
20632068

20642069
__m256d test_mm256_undefined_pd(void) {
2065-
// CHECK-LABEL: test_mm256_undefined_pd
2066-
// CHECK: ret <4 x double> zeroinitializer
2070+
// X64-LABEL: test_mm256_undefined_pd
2071+
// X64: ret <4 x double> zeroinitializer
2072+
//
2073+
// X86-LABEL: test_mm256_undefined_pd
2074+
// X86: store <4 x double> zeroinitializer
20672075
return _mm256_undefined_pd();
20682076
}
20692077

20702078
__m256i test_mm256_undefined_si256(void) {
2071-
// CHECK-LABEL: test_mm256_undefined_si256
2072-
// CHECK: ret <4 x i64> zeroinitializer
2079+
// X64-LABEL: test_mm256_undefined_si256
2080+
// X64: ret <4 x i64> zeroinitializer
2081+
//
2082+
// X86-LABEL: test_mm256_undefined_si256
2083+
// X86: store <4 x i64> zeroinitializer
20732084
return _mm256_undefined_si256();
20742085
}
20752086

clang/test/CodeGen/X86/avx-cmp-builtins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
2+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -O3 -triple=i386-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
23
// FIXME: The shufflevector instructions in test_cmpgt_sd are relying on O3 here.
34

45

clang/test/CodeGen/X86/avx-shuffle-builtins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 -ffreestanding %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
2+
// RUN: %clang_cc1 -ffreestanding %s -O3 -triple=i386-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
23
// FIXME: This is testing optimized generation of shuffle instructions and should be fixed.
34

45

0 commit comments

Comments
 (0)