Skip to content

Commit de7c006

Browse files
authored
[PowerPC] Fix use of FPSCR builtins in smmintrin.h (#67299)
smmintrin.h uses __builtin_mffs, __builtin_mffsl, __builtin_mtfsf and __builtin_set_fpscr_rn. This patch replaces the uses with ppc prefix and implement the missing ones.
1 parent 05dcfa4 commit de7c006

File tree

11 files changed

+99
-31
lines changed

11 files changed

+99
-31
lines changed

clang/include/clang/Basic/BuiltinsPPC.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ TARGET_BUILTIN(__builtin_ppc_extract_exp, "Uid", "", "power9-vector")
151151
TARGET_BUILTIN(__builtin_ppc_extract_sig, "ULLid", "", "power9-vector")
152152
BUILTIN(__builtin_ppc_mtfsb0, "vUIi", "")
153153
BUILTIN(__builtin_ppc_mtfsb1, "vUIi", "")
154+
BUILTIN(__builtin_ppc_mffs, "d", "")
154155
TARGET_BUILTIN(__builtin_ppc_mffsl, "d", "", "isa-v30-instructions")
155156
BUILTIN(__builtin_ppc_mtfsf, "vUIiUi", "")
156157
BUILTIN(__builtin_ppc_mtfsfi, "vUIiUIi", "")
158+
BUILTIN(__builtin_ppc_set_fpscr_rn, "di", "")
157159
TARGET_BUILTIN(__builtin_ppc_insert_exp, "ddULLi", "", "power9-vector")
158160
BUILTIN(__builtin_ppc_fmsub, "dddd", "")
159161
BUILTIN(__builtin_ppc_fmsubs, "ffff", "")

clang/lib/Basic/Targets/PPC.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ static void defineXLCompatMacros(MacroBuilder &Builder) {
264264
Builder.defineMacro("__builtin_minfe", "__builtin_ppc_minfe");
265265
Builder.defineMacro("__builtin_minfl", "__builtin_ppc_minfl");
266266
Builder.defineMacro("__builtin_minfs", "__builtin_ppc_minfs");
267+
Builder.defineMacro("__builtin_mffs", "__builtin_ppc_mffs");
268+
Builder.defineMacro("__builtin_mffsl", "__builtin_ppc_mffsl");
269+
Builder.defineMacro("__builtin_mtfsf", "__builtin_ppc_mtfsf");
270+
Builder.defineMacro("__builtin_set_fpscr_rn", "__builtin_ppc_set_fpscr_rn");
267271
}
268272

269273
/// PPCTargetInfo::getTargetDefines - Return a set of the PowerPC-specific

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17397,6 +17397,11 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID,
1739717397
Value *Op1 = EmitScalarExpr(E->getArg(1));
1739817398
return Builder.CreateFDiv(Op0, Op1, "swdiv");
1739917399
}
17400+
case PPC::BI__builtin_ppc_set_fpscr_rn:
17401+
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::ppc_setrnd),
17402+
{EmitScalarExpr(E->getArg(0))});
17403+
case PPC::BI__builtin_ppc_mffs:
17404+
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::ppc_readflm));
1740017405
}
1740117406
}
1740217407

clang/lib/Headers/ppc_wrappers/smmintrin.h

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifndef NO_WARN_X86_INTRINSICS
1616
/* This header is distributed to simplify porting x86_64 code that
17-
makes explicit use of Intel intrinsics to powerp64/powerpc64le.
17+
makes explicit use of Intel intrinsics to powerpc64/powerpc64le.
1818
1919
It is the user's responsibility to determine if the results are
2020
acceptable and make additional changes as necessary.
@@ -68,10 +68,10 @@ extern __inline __m128d
6868
__asm__("mffsce %0" : "=f"(__fpscr_save.__fr));
6969
__enables_save.__fpscr = __fpscr_save.__fpscr & 0xf8;
7070
#else
71-
__fpscr_save.__fr = __builtin_mffs();
71+
__fpscr_save.__fr = __builtin_ppc_mffs();
7272
__enables_save.__fpscr = __fpscr_save.__fpscr & 0xf8;
7373
__fpscr_save.__fpscr &= ~0xf8;
74-
__builtin_mtfsf(0b00000011, __fpscr_save.__fr);
74+
__builtin_ppc_mtfsf(0b00000011, __fpscr_save.__fr);
7575
#endif
7676
/* Insert an artificial "read/write" reference to the variable
7777
read below, to ensure the compiler does not schedule
@@ -83,10 +83,15 @@ extern __inline __m128d
8383

8484
switch (__rounding) {
8585
case _MM_FROUND_TO_NEAREST_INT:
86-
__fpscr_save.__fr = __builtin_mffsl();
86+
#ifdef _ARCH_PWR9
87+
__fpscr_save.__fr = __builtin_ppc_mffsl();
88+
#else
89+
__fpscr_save.__fr = __builtin_ppc_mffs();
90+
__fpscr_save.__fpscr &= 0x70007f0ffL;
91+
#endif
8792
__attribute__((fallthrough));
8893
case _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC:
89-
__builtin_set_fpscr_rn(0b00);
94+
__builtin_ppc_set_fpscr_rn(0b00);
9095
/* Insert an artificial "read/write" reference to the variable
9196
read below, to ensure the compiler does not schedule
9297
a read/use of the variable before the FPSCR is modified, above.
@@ -102,7 +107,7 @@ extern __inline __m128d
102107
This can be removed if and when GCC PR102783 is fixed.
103108
*/
104109
__asm__("" : : "wa"(__r));
105-
__builtin_set_fpscr_rn(__fpscr_save.__fpscr);
110+
__builtin_ppc_set_fpscr_rn(__fpscr_save.__fpscr);
106111
break;
107112
case _MM_FROUND_TO_NEG_INF:
108113
case _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC:
@@ -128,9 +133,14 @@ extern __inline __m128d
128133
*/
129134
__asm__("" : : "wa"(__r));
130135
/* Restore enabled exceptions. */
131-
__fpscr_save.__fr = __builtin_mffsl();
136+
#ifdef _ARCH_PWR9
137+
__fpscr_save.__fr = __builtin_ppc_mffsl();
138+
#else
139+
__fpscr_save.__fr = __builtin_ppc_mffs();
140+
__fpscr_save.__fpscr &= 0x70007f0ffL;
141+
#endif
132142
__fpscr_save.__fpscr |= __enables_save.__fpscr;
133-
__builtin_mtfsf(0b00000011, __fpscr_save.__fr);
143+
__builtin_ppc_mtfsf(0b00000011, __fpscr_save.__fr);
134144
}
135145
return (__m128d)__r;
136146
}
@@ -159,10 +169,10 @@ extern __inline __m128
159169
__asm__("mffsce %0" : "=f"(__fpscr_save.__fr));
160170
__enables_save.__fpscr = __fpscr_save.__fpscr & 0xf8;
161171
#else
162-
__fpscr_save.__fr = __builtin_mffs();
172+
__fpscr_save.__fr = __builtin_ppc_mffs();
163173
__enables_save.__fpscr = __fpscr_save.__fpscr & 0xf8;
164174
__fpscr_save.__fpscr &= ~0xf8;
165-
__builtin_mtfsf(0b00000011, __fpscr_save.__fr);
175+
__builtin_ppc_mtfsf(0b00000011, __fpscr_save.__fr);
166176
#endif
167177
/* Insert an artificial "read/write" reference to the variable
168178
read below, to ensure the compiler does not schedule
@@ -174,10 +184,15 @@ extern __inline __m128
174184

175185
switch (__rounding) {
176186
case _MM_FROUND_TO_NEAREST_INT:
177-
__fpscr_save.__fr = __builtin_mffsl();
187+
#ifdef _ARCH_PWR9
188+
__fpscr_save.__fr = __builtin_ppc_mffsl();
189+
#else
190+
__fpscr_save.__fr = __builtin_ppc_mffs();
191+
__fpscr_save.__fpscr &= 0x70007f0ffL;
192+
#endif
178193
__attribute__((fallthrough));
179194
case _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC:
180-
__builtin_set_fpscr_rn(0b00);
195+
__builtin_ppc_set_fpscr_rn(0b00);
181196
/* Insert an artificial "read/write" reference to the variable
182197
read below, to ensure the compiler does not schedule
183198
a read/use of the variable before the FPSCR is modified, above.
@@ -193,7 +208,7 @@ extern __inline __m128
193208
This can be removed if and when GCC PR102783 is fixed.
194209
*/
195210
__asm__("" : : "wa"(__r));
196-
__builtin_set_fpscr_rn(__fpscr_save.__fpscr);
211+
__builtin_ppc_set_fpscr_rn(__fpscr_save.__fpscr);
197212
break;
198213
case _MM_FROUND_TO_NEG_INF:
199214
case _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC:
@@ -219,9 +234,14 @@ extern __inline __m128
219234
*/
220235
__asm__("" : : "wa"(__r));
221236
/* Restore enabled exceptions. */
222-
__fpscr_save.__fr = __builtin_mffsl();
237+
#ifdef _ARCH_PWR9
238+
__fpscr_save.__fr = __builtin_ppc_mffsl();
239+
#else
240+
__fpscr_save.__fr = __builtin_ppc_mffs();
241+
__fpscr_save.__fpscr &= 0x70007f0ffL;
242+
#endif
223243
__fpscr_save.__fpscr |= __enables_save.__fpscr;
224-
__builtin_mtfsf(0b00000011, __fpscr_save.__fr);
244+
__builtin_ppc_mtfsf(0b00000011, __fpscr_save.__fr);
225245
}
226246
return (__m128)__r;
227247
}

clang/test/CodeGen/PowerPC/builtins-ppc.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// REQUIRES: powerpc-registered-target
2-
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - \
3+
// RUN: | FileCheck %s
4+
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - \
5+
// RUN: -target-cpu pwr9 | FileCheck %s --check-prefixes=P9,CHECK
36

47
void test_eh_return_data_regno()
58
{
@@ -26,14 +29,20 @@ void test_builtin_ppc_setrnd() {
2629

2730
// CHECK: call double @llvm.ppc.setrnd(i32 %2)
2831
res = __builtin_setrnd(x);
32+
33+
// CHECK: call double @llvm.ppc.setrnd(i32 %4)
34+
res = __builtin_ppc_set_fpscr_rn(x);
2935
}
3036

3137
void test_builtin_ppc_flm() {
3238
volatile double res;
3339
// CHECK: call double @llvm.ppc.readflm()
3440
res = __builtin_readflm();
3541

36-
// CHECK: call double @llvm.ppc.setflm(double %1)
42+
// CHECK: call double @llvm.ppc.readflm()
43+
res = __builtin_ppc_mffs();
44+
45+
// CHECK: call double @llvm.ppc.setflm(double %2)
3746
res = __builtin_setflm(res);
3847

3948
#ifdef _ARCH_PWR9

clang/test/CodeGen/PowerPC/ppc-emmintrin.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
99
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK-P10
1010

11+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
12+
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
13+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
14+
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
15+
1116
// RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
1217
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
1318
// RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \

clang/test/CodeGen/PowerPC/ppc-mmintrin.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr9 -DNO_WARN_X86_INTRINSICS %s \
1010
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n| FileCheck %s --check-prefixes=CHECK-P9,CHECK,CHECK-LE
1111

12+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s \
13+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
14+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr9 -DNO_WARN_X86_INTRINSICS %s \
15+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
16+
1217
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-freebsd13.0 -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s \
1318
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK-P8,CHECK,CHECK-BE
1419
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-freebsd13.0 -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s \

clang/test/CodeGen/PowerPC/ppc-pmmintrin.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr8 -DNO_MM_MALLOC -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
1414
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
1515

16+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-gnu-linux -mcpu=pwr8 -DNO_MM_MALLOC -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
17+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
18+
1619
#include <pmmintrin.h>
1720

1821
__m128d resd, md1, md2;

clang/test/CodeGen/PowerPC/ppc-smmintrin.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
1616
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefix=P10
1717

18+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
19+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
20+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
21+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
22+
1823
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-freebsd13.0 -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
1924
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
2025
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-freebsd13.0 -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
@@ -239,44 +244,48 @@ test_round() {
239244
// CHECK-LABEL: @test_round
240245

241246
// CHECK-LABEL: define available_externally <4 x float> @_mm_round_ps(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
242-
// CHECK: call signext i32 @__builtin_mffs()
243-
// CHECK: call signext i32 @__builtin_mtfsf(i32 noundef signext 3, double noundef %{{[0-9a-zA-Z_.]+}})
247+
// CHECK: call double @llvm.ppc.readflm()
248+
// CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
244249
// CHECK: %{{[0-9a-zA-Z_.]+}} = call <4 x float> asm "", "=^wa,0"
245-
// CHECK: call signext i32 @__builtin_mffsl()
246-
// CHECK: call signext i32 @__builtin_set_fpscr_rn(i32 noundef signext 0)
250+
// CHECK: call double @llvm.ppc.readflm()
251+
// P10: call double @llvm.ppc.mffsl()
252+
// CHECK: call double @llvm.ppc.setrnd(i32 0)
247253
// CHECK: %{{[0-9a-zA-Z_.]+}} = call <4 x float> asm "", "=^wa,0"
248254
// CHECK: call <4 x float> @vec_rint(float vector[4])
249255
// CHECK: call void asm sideeffect "", "^wa"
250-
// CHECK: call signext i32 @__builtin_set_fpscr_rn(i64 noundef %{{[0-9a-zA-Z_.]+}})
256+
// CHECK: call double @llvm.ppc.setrnd(i32 %{{[0-9a-zA-Z_.]+}})
251257
// CHECK: call <4 x float> @vec_floor(float vector[4])
252258
// CHECK: call <4 x float> @vec_ceil(float vector[4])
253259
// CHECK: call <4 x float> @vec_trunc(float vector[4])
254260
// CHECK: call <4 x float> @vec_rint(float vector[4])
255261
// CHECK: call void asm sideeffect "", "^wa"
256-
// CHECK: call signext i32 @__builtin_mffsl()
257-
// CHECK: call signext i32 @__builtin_mtfsf(i32 noundef signext 3, double noundef %{{[0-9a-zA-Z_.]+}})
262+
// CHECK: call double @llvm.ppc.readflm()
263+
// P10: call double @llvm.ppc.mffsl()
264+
// CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
258265

259266
// CHECK-LABEL: define available_externally <4 x float> @_mm_round_ss(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, <4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
260267
// CHECK: call <4 x float> @_mm_round_ps(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
261268
// CHECK: extractelement <4 x float> %{{[0-9a-zA-Z_.]+}}, i32 0
262269

263270
// CHECK-LABEL: define available_externally <2 x double> @_mm_round_pd(<2 x double> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
264-
// CHECK: call signext i32 @__builtin_mffs()
265-
// CHECK: call signext i32 @__builtin_mtfsf(i32 noundef signext 3, double noundef %{{[0-9a-zA-Z_.]+}})
271+
// CHECK: call double @llvm.ppc.readflm()
272+
// CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
266273
// CHECK: %{{[0-9a-zA-Z_.]+}} = call <2 x double> asm "", "=^wa,0"
267-
// CHECK: call signext i32 @__builtin_mffsl()
268-
// CHECK: call signext i32 @__builtin_set_fpscr_rn(i32 noundef signext 0)
274+
// CHECK: call double @llvm.ppc.readflm()
275+
// P10: call double @llvm.ppc.mffsl()
276+
// CHECK: call double @llvm.ppc.setrnd(i32 0)
269277
// CHECK: %{{[0-9a-zA-Z_.]+}} = call <2 x double> asm "", "=^wa,0"
270278
// CHECK: call <2 x double> @vec_rint(double vector[2])
271279
// CHECK: call void asm sideeffect "", "^wa"
272-
// CHECK: call signext i32 @__builtin_set_fpscr_rn(i64 noundef %{{[0-9a-zA-Z_.]+}})
280+
// CHECK: call double @llvm.ppc.setrnd(i32 %{{[0-9a-zA-Z_.]+}})
273281
// CHECK: call <2 x double> @vec_floor(double vector[2])
274282
// CHECK: call <2 x double> @vec_ceil(double vector[2])
275283
// CHECK: call <2 x double> @vec_trunc(double vector[2])
276284
// CHECK: call <2 x double> @vec_rint(double vector[2])
277285
// CHECK: call void asm sideeffect "", "^wa"
278-
// CHECK: call signext i32 @__builtin_mffsl()
279-
// CHECK: call signext i32 @__builtin_mtfsf(i32 noundef signext 3, double noundef %{{[0-9a-zA-Z_.]+}})
286+
// CHECK: call double @llvm.ppc.readflm()
287+
// P10: call double @llvm.ppc.mffsl()
288+
// CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
280289

281290
// CHECK-LABEL: define available_externally <2 x double> @_mm_round_sd(<2 x double> noundef %{{[0-9a-zA-Z_.]+}}, <2 x double> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
282291
// CHECK: call <2 x double> @_mm_round_pd(<2 x double> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})

clang/test/CodeGen/PowerPC/ppc-tmmintrin.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
1414
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
1515

16+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-gnu-linux -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
17+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
18+
1619
#include <tmmintrin.h>
1720

1821
__m64 res, m1, m2;

clang/test/CodeGen/PowerPC/ppc-x86gprintrin.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr7 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
1313
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
1414

15+
// RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr7 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
16+
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
17+
1518
#include <x86gprintrin.h>
1619

1720
unsigned short us;

0 commit comments

Comments
 (0)