11// RUN: %clang_cc1 -no-opaque-pointers -Werror -Wno-atomic-alignment -triple powerpc64le-linux-gnu \
2- // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64-PWR8
2+ // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64-QUADWORD-ATOMICS
33// RUN: %clang_cc1 -no-opaque-pointers -Werror -Wno-atomic-alignment -triple powerpc64le-linux-gnu \
44// RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64
55// RUN: %clang_cc1 -no-opaque-pointers -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
66// RUN: -target-cpu pwr7 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64
7+ // RUN: %clang_cc1 -no-opaque-pointers -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
8+ // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64
9+ // RUN: %clang_cc1 -no-opaque-pointers -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
10+ // RUN: -mabi=quadword-atomics -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s \
11+ // RUN: --check-prefix=PPC64-QUADWORD-ATOMICS
12+
713
814typedef struct {
915 char x [16 ];
@@ -13,8 +19,8 @@ typedef _Atomic(Q) AtomicQ;
1319
1420typedef __int128_t int128_t ;
1521
16- // PPC64-PWR8 -LABEL: @test_load(
17- // PPC64-PWR8 : [[TMP3:%.*]] = load atomic i128, i128* [[TMP1:%.*]] acquire, align 16
22+ // PPC64-QUADWORD-ATOMICS -LABEL: @test_load(
23+ // PPC64-QUADWORD-ATOMICS : [[TMP3:%.*]] = load atomic i128, i128* [[TMP1:%.*]] acquire, align 16
1824//
1925// PPC64-LABEL: @test_load(
2026// PPC64: call void @__atomic_load(i64 noundef 16, i8* noundef [[TMP3:%.*]], i8* noundef [[TMP4:%.*]], i32 noundef signext 2)
@@ -24,8 +30,8 @@ Q test_load(AtomicQ *ptr) {
2430 return __c11_atomic_load (ptr , __ATOMIC_ACQUIRE );
2531}
2632
27- // PPC64-PWR8 -LABEL: @test_store(
28- // PPC64-PWR8 : store atomic i128 [[TMP6:%.*]], i128* [[TMP4:%.*]] release, align 16
33+ // PPC64-QUADWORD-ATOMICS -LABEL: @test_store(
34+ // PPC64-QUADWORD-ATOMICS : store atomic i128 [[TMP6:%.*]], i128* [[TMP4:%.*]] release, align 16
2935//
3036// PPC64-LABEL: @test_store(
3137// PPC64: call void @__atomic_store(i64 noundef 16, i8* noundef [[TMP6:%.*]], i8* noundef [[TMP7:%.*]], i32 noundef signext 3)
@@ -35,8 +41,8 @@ void test_store(Q val, AtomicQ *ptr) {
3541 __c11_atomic_store (ptr , val , __ATOMIC_RELEASE );
3642}
3743
38- // PPC64-PWR8 -LABEL: @test_add(
39- // PPC64-PWR8 : [[TMP3:%.*]] = atomicrmw add i128* [[TMP0:%.*]], i128 [[TMP2:%.*]] monotonic, align 16
44+ // PPC64-QUADWORD-ATOMICS -LABEL: @test_add(
45+ // PPC64-QUADWORD-ATOMICS : [[TMP3:%.*]] = atomicrmw add i128* [[TMP0:%.*]], i128 [[TMP2:%.*]] monotonic, align 16
4046//
4147// PPC64-LABEL: @test_add(
4248// PPC64: [[CALL:%.*]] = call i128 @__atomic_fetch_add_16(i8* noundef [[TMP2:%.*]], i128 noundef [[TMP3:%.*]], i32 noundef signext 0)
@@ -46,8 +52,8 @@ void test_add(_Atomic(int128_t) *ptr, int128_t x) {
4652 __c11_atomic_fetch_add (ptr , x , __ATOMIC_RELAXED );
4753}
4854
49- // PPC64-PWR8 -LABEL: @test_xchg(
50- // PPC64-PWR8 : [[TMP8:%.*]] = atomicrmw xchg i128* [[TMP4:%.*]], i128 [[TMP7:%.*]] seq_cst, align 16
55+ // PPC64-QUADWORD-ATOMICS -LABEL: @test_xchg(
56+ // PPC64-QUADWORD-ATOMICS : [[TMP8:%.*]] = atomicrmw xchg i128* [[TMP4:%.*]], i128 [[TMP7:%.*]] seq_cst, align 16
5157//
5258// PPC64-LABEL: @test_xchg(
5359// PPC64: call void @__atomic_exchange(i64 noundef 16, i8* noundef [[TMP7:%.*]], i8* noundef [[TMP8:%.*]], i8* noundef [[TMP9:%.*]], i32 noundef signext 5)
@@ -57,8 +63,8 @@ Q test_xchg(AtomicQ *ptr, Q new) {
5763 return __c11_atomic_exchange (ptr , new , __ATOMIC_SEQ_CST );
5864}
5965
60- // PPC64-PWR8 -LABEL: @test_cmpxchg(
61- // PPC64-PWR8 : [[TMP10:%.*]] = cmpxchg i128* [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
66+ // PPC64-QUADWORD-ATOMICS -LABEL: @test_cmpxchg(
67+ // PPC64-QUADWORD-ATOMICS : [[TMP10:%.*]] = cmpxchg i128* [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
6268//
6369// PPC64-LABEL: @test_cmpxchg(
6470// PPC64: [[CALL:%.*]] = call zeroext i1 @__atomic_compare_exchange(i64 noundef 16, i8* noundef [[TMP8:%.*]], i8* noundef [[TMP9:%.*]], i8* noundef [[TMP10:%.*]], i32 noundef signext 5, i32 noundef signext 0)
@@ -68,8 +74,8 @@ int test_cmpxchg(AtomicQ *ptr, Q *cmp, Q new) {
6874 return __c11_atomic_compare_exchange_strong (ptr , cmp , new , __ATOMIC_SEQ_CST , __ATOMIC_RELAXED );
6975}
7076
71- // PPC64-PWR8 -LABEL: @test_cmpxchg_weak(
72- // PPC64-PWR8 : [[TMP10:%.*]] = cmpxchg weak i128* [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
77+ // PPC64-QUADWORD-ATOMICS -LABEL: @test_cmpxchg_weak(
78+ // PPC64-QUADWORD-ATOMICS : [[TMP10:%.*]] = cmpxchg weak i128* [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
7379//
7480// PPC64-LABEL: @test_cmpxchg_weak(
7581// PPC64: [[CALL:%.*]] = call zeroext i1 @__atomic_compare_exchange(i64 noundef 16, i8* noundef [[TMP8:%.*]], i8* noundef [[TMP9:%.*]], i8* noundef [[TMP10:%.*]], i32 noundef signext 5, i32 noundef signext 0)
@@ -79,8 +85,8 @@ int test_cmpxchg_weak(AtomicQ *ptr, Q *cmp, Q new) {
7985 return __c11_atomic_compare_exchange_weak (ptr , cmp , new , __ATOMIC_SEQ_CST , __ATOMIC_RELAXED );
8086}
8187
82- // PPC64-PWR8 -LABEL: @is_lock_free(
83- // PPC64-PWR8 : ret i32 1
88+ // PPC64-QUADWORD-ATOMICS -LABEL: @is_lock_free(
89+ // PPC64-QUADWORD-ATOMICS : ret i32 1
8490//
8591// PPC64-LABEL: @is_lock_free(
8692// PPC64: [[CALL:%.*]] = call zeroext i1 @__atomic_is_lock_free(i64 noundef 16, i8* noundef null)
0 commit comments