1
1
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64le-linux-gnu \
2
- // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64-QUADWORD-ATOMICS
2
+ // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s \
3
+ // RUN: --check-prefixes=PPC64,PPC64-QUADWORD-ATOMICS
3
4
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64le-linux-gnu \
4
- // RUN: -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64
5
+ // RUN: -emit-llvm -o - %s | FileCheck %s \
6
+ // RUN: --check-prefixes=PPC64,PPC64-NO-QUADWORD-ATOMICS
5
7
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
6
- // RUN: -target-cpu pwr7 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64
8
+ // RUN: -target-cpu pwr7 -emit-llvm -o - %s | FileCheck %s \
9
+ // RUN: --check-prefixes=PPC64,PPC64-NO-QUADWORD-ATOMICS
7
10
// RUN: %clang_cc1 -Werror -Wno-atomic-alignment -triple powerpc64-unknown-aix \
8
- // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s --check-prefix=PPC64
11
+ // RUN: -target-cpu pwr8 -emit-llvm -o - %s | FileCheck %s \
12
+ // RUN: --check-prefixes=PPC64,PPC64-NO-QUADWORD-ATOMICS
9
13
// RUN: %clang_cc1 -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
14
+ // RUN: -mabi=quadword-atomics -target-cpu pwr8 -emit-llvm -o - %s | \
15
+ // RUN: FileCheck %s --check-prefixes=PPC64, PPC64-QUADWORD-ATOMICS
12
16
13
17
14
18
typedef struct {
@@ -19,66 +23,48 @@ typedef _Atomic(Q) AtomicQ;
19
23
20
24
typedef __int128_t int128_t ;
21
25
22
- // PPC64-QUADWORD-ATOMICS-LABEL: @test_load(
23
- // PPC64-QUADWORD-ATOMICS: [[TMP3:%.*]] = load atomic i128, ptr [[TMP1:%.*]] acquire, align 16
24
- //
25
26
// PPC64-LABEL: @test_load(
26
- // PPC64: call void @__atomic_load(i64 noundef 16, ptr noundef [[TMP3:%.*]], ptr noundef [[TMP4 :%.*]], i32 noundef signext 2)
27
+ // PPC64: [[TMP3:%.*]] = load atomic i128 , ptr [[TMP1 :%.*]] acquire, align 16
27
28
//
28
29
Q test_load (AtomicQ * ptr ) {
29
30
// expected-no-diagnostics
30
31
return __c11_atomic_load (ptr , __ATOMIC_ACQUIRE );
31
32
}
32
33
33
- // PPC64-QUADWORD-ATOMICS-LABEL: @test_store(
34
- // PPC64-QUADWORD-ATOMICS: store atomic i128 [[TMP6:%.*]], ptr [[TMP4:%.*]] release, align 16
35
- //
36
34
// PPC64-LABEL: @test_store(
37
- // PPC64: call void @__atomic_store(i64 noundef 16, ptr noundef [[TMP6:%.*]], ptr noundef [[TMP7 :%.*]], i32 noundef signext 3)
35
+ // PPC64: store atomic i128 [[TMP6:%.*]], ptr [[TMP4 :%.*]] release, align 16
38
36
//
39
37
void test_store (Q val , AtomicQ * ptr ) {
40
38
// expected-no-diagnostics
41
39
__c11_atomic_store (ptr , val , __ATOMIC_RELEASE );
42
40
}
43
41
44
- // PPC64-QUADWORD-ATOMICS-LABEL: @test_add(
45
- // PPC64-QUADWORD-ATOMICS: [[TMP3:%.*]] = atomicrmw add ptr [[TMP0:%.*]], i128 [[TMP2:%.*]] monotonic, align 16
46
- //
47
42
// PPC64-LABEL: @test_add(
48
- // PPC64: [[CALL :%.*]] = call i128 @__atomic_fetch_add_16( ptr noundef [[TMP2 :%.*]], i128 noundef [[TMP3 :%.*]], i32 noundef signext 0)
43
+ // PPC64: [[ATOMICRMW :%.*]] = atomicrmw add ptr [[TMP0 :%.*]], i128 [[TMP2 :%.*]] monotonic, align 16
49
44
//
50
45
void test_add (_Atomic (int128_t ) * ptr , int128_t x ) {
51
46
// expected-no-diagnostics
52
47
__c11_atomic_fetch_add (ptr , x , __ATOMIC_RELAXED );
53
48
}
54
49
55
- // PPC64-QUADWORD-ATOMICS-LABEL: @test_xchg(
56
- // PPC64-QUADWORD-ATOMICS: [[TMP8:%.*]] = atomicrmw xchg ptr [[TMP4:%.*]], i128 [[TMP7:%.*]] seq_cst, align 16
57
- //
58
50
// PPC64-LABEL: @test_xchg(
59
- // PPC64: call void @__atomic_exchange(i64 noundef 16, ptr noundef [[TMP7 :%.*]], ptr noundef [[TMP8 :%.*]], ptr noundef [[TMP9 :%.*]], i32 noundef signext 5)
51
+ // PPC64: [[TMP8 :%.*]] = atomicrmw xchg ptr [[TMP4 :%.*]], i128 [[TMP7 :%.*]] seq_cst, align 16
60
52
//
61
53
Q test_xchg (AtomicQ * ptr , Q new ) {
62
54
// expected-no-diagnostics
63
55
return __c11_atomic_exchange (ptr , new , __ATOMIC_SEQ_CST );
64
56
}
65
57
66
- // PPC64-QUADWORD-ATOMICS-LABEL: @test_cmpxchg(
67
- // PPC64-QUADWORD-ATOMICS: [[TMP10:%.*]] = cmpxchg ptr [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
68
- //
69
58
// PPC64-LABEL: @test_cmpxchg(
70
- // PPC64: [[CALL :%.*]] = call zeroext i1 @__atomic_compare_exchange(i64 noundef 16, ptr noundef [[TMP8 :%.*]], ptr noundef [[TMP9 :%.*]], ptr noundef [[TMP10 :%.*]], i32 noundef signext 5, i32 noundef signext 0)
59
+ // PPC64: [[TMP10 :%.*]] = cmpxchg ptr [[TMP5 :%.*]], i128 [[TMP8 :%.*]], i128 [[TMP9 :%.*]] seq_cst monotonic, align 16
71
60
//
72
61
int test_cmpxchg (AtomicQ * ptr , Q * cmp , Q new ) {
73
62
// expected-no-diagnostics
74
63
return __c11_atomic_compare_exchange_strong (ptr , cmp , new , __ATOMIC_SEQ_CST , __ATOMIC_RELAXED );
75
64
}
76
65
77
- // PPC64-QUADWORD-ATOMICS-LABEL: @test_cmpxchg_weak(
78
- // PPC64-QUADWORD-ATOMICS: [[TMP10:%.*]] = cmpxchg weak ptr [[TMP5:%.*]], i128 [[TMP8:%.*]], i128 [[TMP9:%.*]] seq_cst monotonic, align 16
79
- //
80
66
// PPC64-LABEL: @test_cmpxchg_weak(
81
- // PPC64: [[CALL :%.*]] = call zeroext i1 @__atomic_compare_exchange(i64 noundef 16, ptr noundef [[TMP8 :%.*]], ptr noundef [[TMP9 :%.*]], ptr noundef [[TMP10 :%.*]], i32 noundef signext 5, i32 noundef signext 0)
67
+ // PPC64: [[TMP10 :%.*]] = cmpxchg weak ptr [[TMP5 :%.*]], i128 [[TMP8 :%.*]], i128 [[TMP9 :%.*]] seq_cst monotonic, align 16
82
68
//
83
69
int test_cmpxchg_weak (AtomicQ * ptr , Q * cmp , Q new ) {
84
70
// expected-no-diagnostics
@@ -88,8 +74,8 @@ int test_cmpxchg_weak(AtomicQ *ptr, Q *cmp, Q new) {
88
74
// PPC64-QUADWORD-ATOMICS-LABEL: @is_lock_free(
89
75
// PPC64-QUADWORD-ATOMICS: ret i32 1
90
76
//
91
- // PPC64-LABEL: @is_lock_free(
92
- // PPC64: [[CALL:%.*]] = call zeroext i1 @__atomic_is_lock_free(i64 noundef 16, ptr noundef null)
77
+ // PPC64-NO-QUADWORD-ATOMICS- LABEL: @is_lock_free(
78
+ // PPC64-NO-QUADWORD-ATOMICS : [[CALL:%.*]] = call zeroext i1 @__atomic_is_lock_free(i64 noundef 16, ptr noundef null)
93
79
//
94
80
int is_lock_free () {
95
81
AtomicQ q ;
0 commit comments