Lines Matching refs:addr
6 int atomic_inc(int *addr) {
9 OldVal = __builtin_arm_ldrex(addr);
10 Failure = __builtin_arm_strex(OldVal + 1, addr);
17 // CHECK: [[OLDVAL:%.*]] = tail call i32 @llvm.arm.ldrex.p0i32(i32* %addr)
19 // CHECK: [[FAILURE:%.*]] = tail call i32 @llvm.arm.strex.p0i32(i32 [[INC]], i32* %addr)
24 // CHECK-ARM64: [[OLDVAL:%.*]] = tail call i64 @llvm.aarch64.ldxr.p0i32(i32* %addr)
27 // CHECK-ARM64: [[FAILURE:%.*]] = tail call i32 @llvm.aarch64.stxr.p0i32(i64 [[TRUNC]], i32* %addr)
35 int test_ldrex(char *addr, long long *addr64, float *addrfloat) {
39 sum += __builtin_arm_ldrex(addr);
40 // CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldrex.p0i8(i8* %addr)
43 // CHECK-ARM64: [[INTRES:%.*]] = tail call i64 @llvm.aarch64.ldxr.p0i8(i8* %addr)
48 sum += __builtin_arm_ldrex((short *)addr);
49 // CHECK: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
54 // CHECK-ARM64: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
60 sum += __builtin_arm_ldrex((int *)addr);
61 // CHECK: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
64 // CHECK-ARM64: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
68 sum += __builtin_arm_ldrex((long long *)addr);
69 // CHECK: call { i32, i32 } @llvm.arm.ldrexd(i8* %addr)
71 // CHECK-ARM64: [[ADDR64:%.*]] = bitcast i8* %addr to i64*
90 sum += __builtin_arm_ldrex((double *)addr);
91 // CHECK: [[STRUCTRES:%.*]] = tail call { i32, i32 } @llvm.arm.ldrexd(i8* %addr)
103 sum += *__builtin_arm_ldrex((int **)addr);
110 sum += __builtin_arm_ldrex((struct Simple **)addr)->a;
119 int test_ldaex(char *addr, long long *addr64, float *addrfloat) {
123 sum += __builtin_arm_ldaex(addr);
124 // CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldaex.p0i8(i8* %addr)
127 // CHECK-ARM64: [[INTRES:%.*]] = tail call i64 @llvm.aarch64.ldaxr.p0i8(i8* %addr)
132 sum += __builtin_arm_ldaex((short *)addr);
133 // CHECK: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
138 // CHECK-ARM64: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
144 sum += __builtin_arm_ldaex((int *)addr);
145 // CHECK: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
148 // CHECK-ARM64: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
152 sum += __builtin_arm_ldaex((long long *)addr);
153 // CHECK: call { i32, i32 } @llvm.arm.ldaexd(i8* %addr)
155 // CHECK-ARM64: [[ADDR64:%.*]] = bitcast i8* %addr to i64*
174 sum += __builtin_arm_ldaex((double *)addr);
175 // CHECK: [[STRUCTRES:%.*]] = tail call { i32, i32 } @llvm.arm.ldaexd(i8* %addr)
187 sum += *__builtin_arm_ldaex((int **)addr);
194 sum += __builtin_arm_ldaex((struct Simple **)addr)->a;
203 int test_strex(char *addr) {
208 res |= __builtin_arm_strex(4, addr);
209 // CHECK: call i32 @llvm.arm.strex.p0i8(i32 4, i8* %addr)
211 // CHECK-ARM64: call i32 @llvm.aarch64.stxr.p0i8(i64 4, i8* %addr)
213 res |= __builtin_arm_strex(42, (short *)addr);
214 // CHECK: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
217 // CHECK-ARM64: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
220 res |= __builtin_arm_strex(42, (int *)addr);
221 // CHECK: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
224 // CHECK-ARM64: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
227 res |= __builtin_arm_strex(42, (long long *)addr);
228 // CHECK: call i32 @llvm.arm.strexd(i32 42, i32 0, i8* %addr)
230 // CHECK-ARM64: [[ADDR64:%.*]] = bitcast i8* %addr to i64*
233 res |= __builtin_arm_strex(2.71828f, (float *)addr);
238 res |= __builtin_arm_strex(3.14159, (double *)addr);
239 // CHECK: call i32 @llvm.arm.strexd(i32 -266631570, i32 1074340345, i8* %addr)
243 res |= __builtin_arm_strex(&var, (struct Simple **)addr);
253 int test_stlex(char *addr) {
258 res |= __builtin_arm_stlex(4, addr);
259 // CHECK: call i32 @llvm.arm.stlex.p0i8(i32 4, i8* %addr)
261 // CHECK-ARM64: call i32 @llvm.aarch64.stlxr.p0i8(i64 4, i8* %addr)
263 res |= __builtin_arm_stlex(42, (short *)addr);
264 // CHECK: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
267 // CHECK-ARM64: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
270 res |= __builtin_arm_stlex(42, (int *)addr);
271 // CHECK: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
274 // CHECK-ARM64: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
277 res |= __builtin_arm_stlex(42, (long long *)addr);
278 // CHECK: call i32 @llvm.arm.stlexd(i32 42, i32 0, i8* %addr)
280 // CHECK-ARM64: [[ADDR64:%.*]] = bitcast i8* %addr to i64*
283 res |= __builtin_arm_stlex(2.71828f, (float *)addr);
288 res |= __builtin_arm_stlex(3.14159, (double *)addr);
289 // CHECK: call i32 @llvm.arm.stlexd(i32 -266631570, i32 1074340345, i8* %addr)
293 res |= __builtin_arm_stlex(&var, (struct Simple **)addr);
315 __int128 test_ldrex_128(__int128 *addr) {
318 return __builtin_arm_ldrex(addr);
319 // CHECK-ARM64: [[ADDR8:%.*]] = bitcast i128* %addr to i8*
330 int test_strex_128(__int128 *addr, __int128 val) {
333 return __builtin_arm_strex(val, addr);
337 // CHECK-ARM64: [[ADDR8:%.*]] = bitcast i128* %addr to i8*
341 __int128 test_ldaex_128(__int128 *addr) {
344 return __builtin_arm_ldaex(addr);
345 // CHECK-ARM64: [[ADDR8:%.*]] = bitcast i128* %addr to i8*
356 int test_stlex_128(__int128 *addr, __int128 val) {
359 return __builtin_arm_stlex(val, addr);
363 // CHECK-ARM64: [[ADDR8:%.*]] = bitcast i128* %addr to i8*