Skip to content

Commit aa5e8c5

Browse files
committed
[PowerPC] Add support for AMO store builtins
1 parent 1142c93 commit aa5e8c5

File tree

12 files changed

+398
-2
lines changed

12 files changed

+398
-2
lines changed

clang/include/clang/Basic/BuiltinsPPC.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,11 @@ TARGET_BUILTIN(__builtin_amo_lwat_cond, "UiUi*Ii", "", "isa-v30-instructions")
10101010
TARGET_BUILTIN(__builtin_amo_ldat_cond, "ULiULi*Ii", "", "isa-v30-instructions")
10111011
TARGET_BUILTIN(__builtin_amo_lwat_cond_s, "SiSi*Ii", "", "isa-v30-instructions")
10121012
TARGET_BUILTIN(__builtin_amo_ldat_cond_s, "SLiSLi*Ii", "", "isa-v30-instructions")
1013+
TARGET_BUILTIN(__builtin_amo_stwat, "vUi*UiIi", "", "isa-v30-instructions")
1014+
TARGET_BUILTIN(__builtin_amo_stdat, "vULi*ULiIi", "", "isa-v30-instructions")
1015+
TARGET_BUILTIN(__builtin_amo_stwat_s, "vSi*SiIi", "", "isa-v30-instructions")
1016+
TARGET_BUILTIN(__builtin_amo_stdat_s, "vSLi*SLiIi", "", "isa-v30-instructions")
1017+
10131018

10141019
// Set the floating point rounding mode
10151020
BUILTIN(__builtin_setrnd, "di", "")

clang/lib/CodeGen/TargetBuiltins/PPC.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,5 +1386,19 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID,
13861386
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::ppc_amo_ldat_cond),
13871387
{Op0, Op1});
13881388
}
1389+
case PPC::BI__builtin_amo_stwat_s: {
1390+
Value *Op0 = EmitScalarExpr(E->getArg(0));
1391+
Value *Op1 = EmitScalarExpr(E->getArg(1));
1392+
Value *Op2 = EmitScalarExpr(E->getArg(2));
1393+
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::ppc_amo_stwat),
1394+
{Op0, Op1, Op2});
1395+
}
1396+
case PPC::BI__builtin_amo_stdat_s: {
1397+
Value *Op0 = EmitScalarExpr(E->getArg(0));
1398+
Value *Op1 = EmitScalarExpr(E->getArg(1));
1399+
Value *Op2 = EmitScalarExpr(E->getArg(2));
1400+
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::ppc_amo_stdat),
1401+
{Op0, Op1, Op2});
1402+
}
13891403
}
13901404
}

clang/lib/Headers/amo.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,95 @@ static inline int64_t amo_ldat_sswap(int64_t *ptr, int64_t val) {
124124
return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SWAP);
125125
}
126126

127+
/* AMO Store Operation Codes (FC values) */
128+
enum _AMO_ST {
129+
_AMO_ST_ADD = 0x00, /* Store Add */
130+
_AMO_ST_XOR = 0x01, /* Store Xor */
131+
_AMO_ST_IOR = 0x02, /* Store Ior */
132+
_AMO_ST_AND = 0x03, /* Store And */
133+
_AMO_ST_UMAX = 0x04, /* Store Unsigned Maximum */
134+
_AMO_ST_SMAX = 0x05, /* Store Signed Maximum */
135+
_AMO_ST_UMIN = 0x06, /* Store Unsigned Minimum */
136+
_AMO_ST_SMIN = 0x07, /* Store Signed Minimum */
137+
_AMO_ST_TWIN = 0x18 /* Store Twin */
138+
};
139+
140+
/* 32-bit unsigned AMO store operations */
141+
static inline void amo_stwat_add(uint32_t *ptr, uint32_t val) {
142+
__builtin_amo_stwat(ptr, val, _AMO_ST_ADD);
143+
}
144+
145+
static inline void amo_stwat_xor(uint32_t *ptr, uint32_t val) {
146+
__builtin_amo_stwat(ptr, val, _AMO_ST_XOR);
147+
}
148+
149+
static inline void amo_stwat_ior(uint32_t *ptr, uint32_t val) {
150+
__builtin_amo_stwat(ptr, val, _AMO_ST_IOR);
151+
}
152+
153+
static inline void amo_stwat_and(uint32_t *ptr, uint32_t val) {
154+
__builtin_amo_stwat(ptr, val, _AMO_ST_AND);
155+
}
156+
157+
static inline void amo_stwat_umax(uint32_t *ptr, uint32_t val) {
158+
__builtin_amo_stwat(ptr, val, _AMO_ST_UMAX);
159+
}
160+
161+
static inline void amo_stwat_umin(uint32_t *ptr, uint32_t val) {
162+
__builtin_amo_stwat(ptr, val, _AMO_ST_UMIN);
163+
}
164+
165+
/* 32-bit signed AMO store operations */
166+
static inline void amo_stwat_sadd(int32_t *ptr, int32_t val) {
167+
__builtin_amo_stwat_s(ptr, val, _AMO_ST_ADD);
168+
}
169+
170+
static inline void amo_stwat_smax(int32_t *ptr, int32_t val) {
171+
__builtin_amo_stwat_s(ptr, val, _AMO_ST_SMAX);
172+
}
173+
174+
static inline void amo_stwat_smin(int32_t *ptr, int32_t val) {
175+
__builtin_amo_stwat_s(ptr, val, _AMO_ST_SMIN);
176+
}
177+
178+
/* 64-bit unsigned AMO store operations */
179+
static inline void amo_stdat_add(uint64_t *ptr, uint64_t val) {
180+
__builtin_amo_stdat(ptr, val, _AMO_ST_ADD);
181+
}
182+
183+
static inline void amo_stdat_xor(uint64_t *ptr, uint64_t val) {
184+
__builtin_amo_stdat(ptr, val, _AMO_ST_XOR);
185+
}
186+
187+
static inline void amo_stdat_ior(uint64_t *ptr, uint64_t val) {
188+
__builtin_amo_stdat(ptr, val, _AMO_ST_IOR);
189+
}
190+
191+
static inline void amo_stdat_and(uint64_t *ptr, uint64_t val) {
192+
__builtin_amo_stdat(ptr, val, _AMO_ST_AND);
193+
}
194+
195+
static inline void amo_stdat_umax(uint64_t *ptr, uint64_t val) {
196+
__builtin_amo_stdat(ptr, val, _AMO_ST_UMAX);
197+
}
198+
199+
static inline void amo_stdat_umin(uint64_t *ptr, uint64_t val) {
200+
__builtin_amo_stdat(ptr, val, _AMO_ST_UMIN);
201+
}
202+
203+
/* 64-bit signed AMO store operations */
204+
static inline void amo_stdat_sadd(int64_t *ptr, int64_t val) {
205+
__builtin_amo_stdat_s(ptr, val, _AMO_ST_ADD);
206+
}
207+
208+
static inline void amo_stdat_smax(int64_t *ptr, int64_t val) {
209+
__builtin_amo_stdat_s(ptr, val, _AMO_ST_SMAX);
210+
}
211+
212+
static inline void amo_stdat_smin(int64_t *ptr, int64_t val) {
213+
__builtin_amo_stdat_s(ptr, val, _AMO_ST_SMIN);
214+
}
215+
127216
#ifdef __cplusplus
128217
}
129218
#endif

clang/lib/Sema/SemaPPC.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ static bool isPPC_64Builtin(unsigned BuiltinID) {
9595
case PPC::BI__builtin_amo_ldat_cond:
9696
case PPC::BI__builtin_amo_lwat_cond_s:
9797
case PPC::BI__builtin_amo_ldat_cond_s:
98+
case PPC::BI__builtin_amo_stwat:
99+
case PPC::BI__builtin_amo_stdat:
100+
case PPC::BI__builtin_amo_stwat_s:
101+
case PPC::BI__builtin_amo_stdat_s:
98102
return true;
99103
}
100104
return false;
@@ -300,6 +304,30 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const TargetInfo &TI,
300304
return SemaRef.Diag(Arg->getBeginLoc(), diag::err_argument_invalid_range)
301305
<< toString(Result, 10) << "24, 25" << "28" << Arg->getSourceRange();
302306
}
307+
case PPC::BI__builtin_amo_stwat:
308+
case PPC::BI__builtin_amo_stdat:
309+
case PPC::BI__builtin_amo_stwat_s:
310+
case PPC::BI__builtin_amo_stdat_s: {
311+
llvm::APSInt Result;
312+
if (SemaRef.BuiltinConstantArg(TheCall, 2, Result))
313+
return true;
314+
unsigned Val = Result.getZExtValue();
315+
316+
bool IsUnsigned = (BuiltinID == PPC::BI__builtin_amo_stwat ||
317+
BuiltinID == PPC::BI__builtin_amo_stdat);
318+
319+
bool IsValid = IsUnsigned
320+
? llvm::is_contained({0u, 1u, 2u, 3u, 4u, 6u, 24u}, Val)
321+
: llvm::is_contained({0u, 5u, 7u, 24u}, Val);
322+
323+
if (IsValid)
324+
return false;
325+
326+
Expr *Arg = TheCall->getArg(2);
327+
return SemaRef.Diag(Arg->getBeginLoc(), diag::err_argument_invalid_range)
328+
<< toString(Result, 10) << (IsUnsigned ? "0-4, 6" : "0, 5, 7")
329+
<< "24" << Arg->getSourceRange();
330+
}
303331
}
304332
llvm_unreachable("must return from switch");
305333
}

clang/test/CodeGen/PowerPC/builtins-amo-err.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,28 @@ void test_amo() {
5151
__builtin_amo_ldat_cond_s(ptr6, 28);
5252
// FC-ERROR: argument value 0 is outside the valid range [24, 25, 28]
5353
__builtin_amo_ldat_cond_s(ptr6, 0);
54+
55+
unsigned int *ptr9, value9;
56+
// AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
57+
__builtin_amo_stwat(ptr9, value9, 0);
58+
// FC-ERROR: error: argument value 5 is outside the valid range [0-4, 6, 24]
59+
__builtin_amo_stwat(ptr9, value9, 5);
60+
61+
unsigned long int *ptr10, value10;
62+
// AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
63+
__builtin_amo_stdat(ptr10, value10, 24);
64+
// FC-ERROR: error: argument value 10 is outside the valid range [0-4, 6, 24]
65+
__builtin_amo_stdat(ptr10, value10, 10);
66+
67+
signed int *ptr11, value11;
68+
// AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
69+
__builtin_amo_stwat_s(ptr11, value11, 0);
70+
// FC-ERROR: error: argument value 1 is outside the valid range [0, 5, 7, 24]
71+
__builtin_amo_stwat_s(ptr11, value11, 1);
72+
73+
signed long int *ptr12, value12;
74+
// AIX32-ERROR-COUNT-2: error: this builtin is only available on 64-bit targets
75+
__builtin_amo_stdat_s(ptr12, value12, 24);
76+
// FC-ERROR: error: argument value 6 is outside the valid range [0, 5, 7, 24]
77+
__builtin_amo_stdat_s(ptr12, value12, 6);
5478
}

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,69 @@ void test_signed_ldat_cond(long int *ptr, long int * resp) {
156156
*resp = res;
157157
}
158158

159+
// CHECK-LABEL: define dso_local void @test_unsigned_stwat(
160+
// CHECK-SAME: ptr noundef [[PTR:%.*]], i32 noundef zeroext [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
161+
// CHECK-NEXT: [[ENTRY:.*:]]
162+
// CHECK-NEXT: tail call void @llvm.ppc.amo.stwat(ptr [[PTR]], i32 [[VALUE]], i32 24)
163+
// CHECK-NEXT: ret void
164+
//
165+
// AIX-LABEL: define void @test_unsigned_stwat(
166+
// AIX-SAME: ptr noundef [[PTR:%.*]], i32 noundef zeroext [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
167+
// AIX-NEXT: [[ENTRY:.*:]]
168+
// AIX-NEXT: tail call void @llvm.ppc.amo.stwat(ptr [[PTR]], i32 [[VALUE]], i32 24)
169+
// AIX-NEXT: ret void
170+
//
171+
void test_unsigned_stwat(unsigned int *ptr, unsigned int value, unsigned int * resp) {
172+
__builtin_amo_stwat(ptr, value, 24);
173+
}
174+
175+
// CHECK-LABEL: define dso_local void @test_unsigned_stdat(
176+
// CHECK-SAME: ptr noundef [[PTR:%.*]], i64 noundef [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
177+
// CHECK-NEXT: [[ENTRY:.*:]]
178+
// CHECK-NEXT: tail call void @llvm.ppc.amo.stdat(ptr [[PTR]], i64 [[VALUE]], i32 3)
179+
// CHECK-NEXT: ret void
180+
//
181+
// AIX-LABEL: define void @test_unsigned_stdat(
182+
// AIX-SAME: ptr noundef [[PTR:%.*]], i64 noundef [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
183+
// AIX-NEXT: [[ENTRY:.*:]]
184+
// AIX-NEXT: tail call void @llvm.ppc.amo.stdat(ptr [[PTR]], i64 [[VALUE]], i32 3)
185+
// AIX-NEXT: ret void
186+
//
187+
void test_unsigned_stdat(unsigned long int *ptr, unsigned long int value, unsigned long int * resp) {
188+
__builtin_amo_stdat(ptr, value, 3);
189+
}
190+
191+
// CHECK-LABEL: define dso_local void @test_signed_stwat(
192+
// CHECK-SAME: ptr noundef [[PTR:%.*]], i32 noundef signext [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
193+
// CHECK-NEXT: [[ENTRY:.*:]]
194+
// CHECK-NEXT: tail call void @llvm.ppc.amo.stwat(ptr [[PTR]], i32 [[VALUE]], i32 24)
195+
// CHECK-NEXT: ret void
196+
//
197+
// AIX-LABEL: define void @test_signed_stwat(
198+
// AIX-SAME: ptr noundef [[PTR:%.*]], i32 noundef signext [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
199+
// AIX-NEXT: [[ENTRY:.*:]]
200+
// AIX-NEXT: tail call void @llvm.ppc.amo.stwat(ptr [[PTR]], i32 [[VALUE]], i32 24)
201+
// AIX-NEXT: ret void
202+
//
203+
void test_signed_stwat(int *ptr, int value, int * resp) {
204+
__builtin_amo_stwat_s(ptr, value, 24);
205+
}
206+
207+
// CHECK-LABEL: define dso_local void @test_signed_stdat(
208+
// CHECK-SAME: ptr noundef [[PTR:%.*]], i64 noundef [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
209+
// CHECK-NEXT: [[ENTRY:.*:]]
210+
// CHECK-NEXT: tail call void @llvm.ppc.amo.stdat(ptr [[PTR]], i64 [[VALUE]], i32 5)
211+
// CHECK-NEXT: ret void
212+
//
213+
// AIX-LABEL: define void @test_signed_stdat(
214+
// AIX-SAME: ptr noundef [[PTR:%.*]], i64 noundef [[VALUE:%.*]], ptr noundef readnone captures(none) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
215+
// AIX-NEXT: [[ENTRY:.*:]]
216+
// AIX-NEXT: tail call void @llvm.ppc.amo.stdat(ptr [[PTR]], i64 [[VALUE]], i32 5)
217+
// AIX-NEXT: ret void
218+
//
219+
void test_signed_stdat(long int *ptr, long int value, long int * resp) {
220+
__builtin_amo_stdat_s(ptr, value, 5);
221+
}
159222
//.
160223
// CHECK: [[INT_TBAA2]] = !{[[META3:![0-9]+]], [[META3]], i64 0}
161224
// CHECK: [[META3]] = !{!"int", [[META4:![0-9]+]], i64 0}

clang/test/CodeGen/PowerPC/ppc-amo-header.c

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,111 @@ int64_t test_ldat_sswap(int64_t *ptr, int64_t val) {
137137
// CHECK: call i64 @llvm.ppc.amo.ldat(ptr %{{.*}}, i64 %{{.*}}, i32 8)
138138
return amo_ldat_sswap(ptr, val);
139139
}
140+
141+
void test_stwat_add(uint32_t *ptr, uint32_t val) {
142+
// CHECK-LABEL: @test_stwat_add
143+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 0)
144+
return amo_stwat_add(ptr, val);
145+
}
146+
147+
void test_stwat_xor(uint32_t *ptr, uint32_t val) {
148+
// CHECK-LABEL: @test_stwat_xor
149+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 1)
150+
return amo_stwat_xor(ptr, val);
151+
}
152+
153+
void test_stwat_ior(uint32_t *ptr, uint32_t val) {
154+
// CHECK-LABEL: @test_stwat_ior
155+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 2)
156+
return amo_stwat_ior(ptr, val);
157+
}
158+
159+
void test_stwat_and(uint32_t *ptr, uint32_t val) {
160+
// CHECK-LABEL: @test_stwat_and
161+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 3)
162+
return amo_stwat_and(ptr, val);
163+
}
164+
165+
void test_stwat_umax(uint32_t *ptr, uint32_t val) {
166+
// CHECK-LABEL: @test_stwat_umax
167+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 4)
168+
return amo_stwat_umax(ptr, val);
169+
}
170+
171+
void test_stwat_umin(uint32_t *ptr, uint32_t val) {
172+
// CHECK-LABEL: @test_stwat_umin
173+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 6)
174+
return amo_stwat_umin(ptr, val);
175+
}
176+
177+
void test_stwat_sadd(int32_t *ptr, int32_t val) {
178+
// CHECK-LABEL: @test_stwat_sadd
179+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 0)
180+
return amo_stwat_sadd(ptr, val);
181+
}
182+
183+
void test_stwat_smax(int32_t *ptr, int32_t val) {
184+
// CHECK-LABEL: @test_stwat_smax
185+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 5)
186+
return amo_stwat_smax(ptr, val);
187+
}
188+
189+
void test_stwat_smin(int32_t *ptr, int32_t val) {
190+
// CHECK-LABEL: @test_stwat_smin
191+
// CHECK: call void @llvm.ppc.amo.stwat(ptr %{{.*}}, i32 %{{.*}}, i32 7)
192+
return amo_stwat_smin(ptr, val);
193+
}
194+
195+
void test_stdat_add(uint64_t *ptr, uint64_t val) {
196+
// CHECK-LABEL: @test_stdat_add
197+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 0)
198+
return amo_stdat_add(ptr, val);
199+
}
200+
201+
void test_stdat_xor(uint64_t *ptr, uint64_t val) {
202+
// CHECK-LABEL: @test_stdat_xor
203+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 1)
204+
return amo_stdat_xor(ptr, val);
205+
}
206+
207+
void test_stdat_ior(uint64_t *ptr, uint64_t val) {
208+
// CHECK-LABEL: @test_stdat_ior
209+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 2)
210+
return amo_stdat_ior(ptr, val);
211+
}
212+
213+
void test_stdat_and(uint64_t *ptr, uint64_t val) {
214+
// CHECK-LABEL: @test_stdat_and
215+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 3)
216+
return amo_stdat_and(ptr, val);
217+
}
218+
219+
void test_stdat_umax(uint64_t *ptr, uint64_t val) {
220+
// CHECK-LABEL: @test_stdat_umax
221+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 4)
222+
return amo_stdat_umax(ptr, val);
223+
}
224+
225+
void test_stdat_umin(uint64_t *ptr, uint64_t val) {
226+
// CHECK-LABEL: @test_stdat_umin
227+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 6)
228+
return amo_stdat_umin(ptr, val);
229+
}
230+
231+
void test_stdat_sadd(int64_t *ptr, int64_t val) {
232+
// CHECK-LABEL: @test_stdat_sadd
233+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 0)
234+
return amo_stdat_sadd(ptr, val);
235+
}
236+
237+
void test_stdat_smax(int64_t *ptr, int64_t val) {
238+
// CHECK-LABEL: @test_stdat_smax
239+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 5)
240+
return amo_stdat_smax(ptr, val);
241+
}
242+
243+
void test_stdat_smin(int64_t *ptr, int64_t val) {
244+
// CHECK-LABEL: @test_stdat_smin
245+
// CHECK: call void @llvm.ppc.amo.stdat(ptr %{{.*}}, i64 %{{.*}}, i32 7)
246+
return amo_stdat_smin(ptr, val);
247+
}

llvm/include/llvm/IR/IntrinsicsPowerPC.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,4 +2158,13 @@ let TargetPrefix = "ppc" in {
21582158
DefaultAttrsIntrinsic<[llvm_i64_ty],[llvm_ptr_ty,
21592159
llvm_i32_ty],
21602160
[IntrArgMemOnly, ImmArg<ArgIndex<1>>]>;
2161+
2162+
def int_ppc_amo_stwat : ClangBuiltin<"__builtin_amo_stwat">,
2163+
DefaultAttrsIntrinsic<[],[llvm_ptr_ty,
2164+
llvm_i32_ty, llvm_i32_ty],
2165+
[IntrArgMemOnly, ImmArg<ArgIndex<2>>]>;
2166+
def int_ppc_amo_stdat : ClangBuiltin<"__builtin_amo_stdat">,
2167+
DefaultAttrsIntrinsic<[],[llvm_ptr_ty,
2168+
llvm_i64_ty, llvm_i32_ty],
2169+
[IntrArgMemOnly, ImmArg<ArgIndex<2>>]>;
21612170
}

0 commit comments

Comments
 (0)