1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)" 2; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py 3; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.1a -O0 | FileCheck %s --check-prefixes=CHECK,-O0 4; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.1a -O1 | FileCheck %s --check-prefixes=CHECK,-O1 5 6define dso_local void @store_atomic_i8_aligned_unordered(i8 %value, ptr %ptr) { 7; CHECK-LABEL: store_atomic_i8_aligned_unordered: 8; CHECK: strb w0, [x1] 9 store atomic i8 %value, ptr %ptr unordered, align 1 10 ret void 11} 12 13define dso_local void @store_atomic_i8_aligned_monotonic(i8 %value, ptr %ptr) { 14; CHECK-LABEL: store_atomic_i8_aligned_monotonic: 15; CHECK: strb w0, [x1] 16 store atomic i8 %value, ptr %ptr monotonic, align 1 17 ret void 18} 19 20define dso_local void @store_atomic_i8_aligned_release(i8 %value, ptr %ptr) { 21; CHECK-LABEL: store_atomic_i8_aligned_release: 22; CHECK: stlrb w0, [x1] 23 store atomic i8 %value, ptr %ptr release, align 1 24 ret void 25} 26 27define dso_local void @store_atomic_i8_aligned_seq_cst(i8 %value, ptr %ptr) { 28; CHECK-LABEL: store_atomic_i8_aligned_seq_cst: 29; CHECK: stlrb w0, [x1] 30 store atomic i8 %value, ptr %ptr seq_cst, align 1 31 ret void 32} 33 34define dso_local void @store_atomic_i16_aligned_unordered(i16 %value, ptr %ptr) { 35; CHECK-LABEL: store_atomic_i16_aligned_unordered: 36; CHECK: strh w0, [x1] 37 store atomic i16 %value, ptr %ptr unordered, align 2 38 ret void 39} 40 41define dso_local void @store_atomic_i16_aligned_monotonic(i16 %value, ptr %ptr) { 42; CHECK-LABEL: store_atomic_i16_aligned_monotonic: 43; CHECK: strh w0, [x1] 44 store atomic i16 %value, ptr %ptr monotonic, align 2 45 ret void 46} 47 48define dso_local void @store_atomic_i16_aligned_release(i16 %value, ptr %ptr) { 49; CHECK-LABEL: store_atomic_i16_aligned_release: 50; CHECK: stlrh w0, [x1] 51 store atomic i16 %value, ptr %ptr release, align 2 52 ret void 53} 54 55define dso_local void @store_atomic_i16_aligned_seq_cst(i16 %value, ptr %ptr) { 56; CHECK-LABEL: store_atomic_i16_aligned_seq_cst: 57; CHECK: stlrh w0, [x1] 58 store atomic i16 %value, ptr %ptr seq_cst, align 2 59 ret void 60} 61 62define dso_local void @store_atomic_i32_aligned_unordered(i32 %value, ptr %ptr) { 63; CHECK-LABEL: store_atomic_i32_aligned_unordered: 64; CHECK: str w0, [x1] 65 store atomic i32 %value, ptr %ptr unordered, align 4 66 ret void 67} 68 69define dso_local void @store_atomic_i32_aligned_monotonic(i32 %value, ptr %ptr) { 70; CHECK-LABEL: store_atomic_i32_aligned_monotonic: 71; CHECK: str w0, [x1] 72 store atomic i32 %value, ptr %ptr monotonic, align 4 73 ret void 74} 75 76define dso_local void @store_atomic_i32_aligned_release(i32 %value, ptr %ptr) { 77; CHECK-LABEL: store_atomic_i32_aligned_release: 78; CHECK: stlr w0, [x1] 79 store atomic i32 %value, ptr %ptr release, align 4 80 ret void 81} 82 83define dso_local void @store_atomic_i32_aligned_seq_cst(i32 %value, ptr %ptr) { 84; CHECK-LABEL: store_atomic_i32_aligned_seq_cst: 85; CHECK: stlr w0, [x1] 86 store atomic i32 %value, ptr %ptr seq_cst, align 4 87 ret void 88} 89 90define dso_local void @store_atomic_i64_aligned_unordered(i64 %value, ptr %ptr) { 91; CHECK-LABEL: store_atomic_i64_aligned_unordered: 92; CHECK: str x0, [x1] 93 store atomic i64 %value, ptr %ptr unordered, align 8 94 ret void 95} 96 97define dso_local void @store_atomic_i64_aligned_monotonic(i64 %value, ptr %ptr) { 98; CHECK-LABEL: store_atomic_i64_aligned_monotonic: 99; CHECK: str x0, [x1] 100 store atomic i64 %value, ptr %ptr monotonic, align 8 101 ret void 102} 103 104define dso_local void @store_atomic_i64_aligned_release(i64 %value, ptr %ptr) { 105; CHECK-LABEL: store_atomic_i64_aligned_release: 106; CHECK: stlr x0, [x1] 107 store atomic i64 %value, ptr %ptr release, align 8 108 ret void 109} 110 111define dso_local void @store_atomic_i64_aligned_seq_cst(i64 %value, ptr %ptr) { 112; CHECK-LABEL: store_atomic_i64_aligned_seq_cst: 113; CHECK: stlr x0, [x1] 114 store atomic i64 %value, ptr %ptr seq_cst, align 8 115 ret void 116} 117 118define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) { 119; -O0-LABEL: store_atomic_i128_aligned_unordered: 120; -O0: casp x0, x1, x2, x3, [x8] 121; -O0: eor x8, x10, x8 122; -O0: eor x11, x9, x11 123; -O0: orr x8, x8, x11 124; -O0: subs x8, x8, #0 125; 126; -O1-LABEL: store_atomic_i128_aligned_unordered: 127; -O1: ldp x4, x5, [x2] 128; -O1: casp x6, x7, x0, x1, [x2] 129; -O1: cmp x7, x5 130; -O1: ccmp x6, x4, #0, eq 131 store atomic i128 %value, ptr %ptr unordered, align 16 132 ret void 133} 134 135define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) { 136; -O0-LABEL: store_atomic_i128_aligned_monotonic: 137; -O0: casp x0, x1, x2, x3, [x8] 138; -O0: eor x8, x10, x8 139; -O0: eor x11, x9, x11 140; -O0: orr x8, x8, x11 141; -O0: subs x8, x8, #0 142; 143; -O1-LABEL: store_atomic_i128_aligned_monotonic: 144; -O1: ldp x4, x5, [x2] 145; -O1: casp x6, x7, x0, x1, [x2] 146; -O1: cmp x7, x5 147; -O1: ccmp x6, x4, #0, eq 148 store atomic i128 %value, ptr %ptr monotonic, align 16 149 ret void 150} 151 152define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) { 153; -O0-LABEL: store_atomic_i128_aligned_release: 154; -O0: caspl x0, x1, x2, x3, [x8] 155; -O0: eor x8, x10, x8 156; -O0: eor x11, x9, x11 157; -O0: orr x8, x8, x11 158; -O0: subs x8, x8, #0 159; 160; -O1-LABEL: store_atomic_i128_aligned_release: 161; -O1: ldp x4, x5, [x2] 162; -O1: caspl x6, x7, x0, x1, [x2] 163; -O1: cmp x7, x5 164; -O1: ccmp x6, x4, #0, eq 165 store atomic i128 %value, ptr %ptr release, align 16 166 ret void 167} 168 169define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) { 170; -O0-LABEL: store_atomic_i128_aligned_seq_cst: 171; -O0: caspal x0, x1, x2, x3, [x8] 172; -O0: eor x8, x10, x8 173; -O0: eor x11, x9, x11 174; -O0: orr x8, x8, x11 175; -O0: subs x8, x8, #0 176; 177; -O1-LABEL: store_atomic_i128_aligned_seq_cst: 178; -O1: ldp x4, x5, [x2] 179; -O1: caspal x6, x7, x0, x1, [x2] 180; -O1: cmp x7, x5 181; -O1: ccmp x6, x4, #0, eq 182 store atomic i128 %value, ptr %ptr seq_cst, align 16 183 ret void 184} 185 186define dso_local void @store_atomic_i8_unaligned_unordered(i8 %value, ptr %ptr) { 187; CHECK-LABEL: store_atomic_i8_unaligned_unordered: 188; CHECK: strb w0, [x1] 189 store atomic i8 %value, ptr %ptr unordered, align 1 190 ret void 191} 192 193define dso_local void @store_atomic_i8_unaligned_monotonic(i8 %value, ptr %ptr) { 194; CHECK-LABEL: store_atomic_i8_unaligned_monotonic: 195; CHECK: strb w0, [x1] 196 store atomic i8 %value, ptr %ptr monotonic, align 1 197 ret void 198} 199 200define dso_local void @store_atomic_i8_unaligned_release(i8 %value, ptr %ptr) { 201; CHECK-LABEL: store_atomic_i8_unaligned_release: 202; CHECK: stlrb w0, [x1] 203 store atomic i8 %value, ptr %ptr release, align 1 204 ret void 205} 206 207define dso_local void @store_atomic_i8_unaligned_seq_cst(i8 %value, ptr %ptr) { 208; CHECK-LABEL: store_atomic_i8_unaligned_seq_cst: 209; CHECK: stlrb w0, [x1] 210 store atomic i8 %value, ptr %ptr seq_cst, align 1 211 ret void 212} 213 214define dso_local void @store_atomic_i16_unaligned_unordered(i16 %value, ptr %ptr) { 215; CHECK-LABEL: store_atomic_i16_unaligned_unordered: 216; CHECK: bl __atomic_store 217 store atomic i16 %value, ptr %ptr unordered, align 1 218 ret void 219} 220 221define dso_local void @store_atomic_i16_unaligned_monotonic(i16 %value, ptr %ptr) { 222; CHECK-LABEL: store_atomic_i16_unaligned_monotonic: 223; CHECK: bl __atomic_store 224 store atomic i16 %value, ptr %ptr monotonic, align 1 225 ret void 226} 227 228define dso_local void @store_atomic_i16_unaligned_release(i16 %value, ptr %ptr) { 229; CHECK-LABEL: store_atomic_i16_unaligned_release: 230; CHECK: bl __atomic_store 231 store atomic i16 %value, ptr %ptr release, align 1 232 ret void 233} 234 235define dso_local void @store_atomic_i16_unaligned_seq_cst(i16 %value, ptr %ptr) { 236; CHECK-LABEL: store_atomic_i16_unaligned_seq_cst: 237; CHECK: bl __atomic_store 238 store atomic i16 %value, ptr %ptr seq_cst, align 1 239 ret void 240} 241 242define dso_local void @store_atomic_i32_unaligned_unordered(i32 %value, ptr %ptr) { 243; CHECK-LABEL: store_atomic_i32_unaligned_unordered: 244; CHECK: bl __atomic_store 245 store atomic i32 %value, ptr %ptr unordered, align 1 246 ret void 247} 248 249define dso_local void @store_atomic_i32_unaligned_monotonic(i32 %value, ptr %ptr) { 250; CHECK-LABEL: store_atomic_i32_unaligned_monotonic: 251; CHECK: bl __atomic_store 252 store atomic i32 %value, ptr %ptr monotonic, align 1 253 ret void 254} 255 256define dso_local void @store_atomic_i32_unaligned_release(i32 %value, ptr %ptr) { 257; CHECK-LABEL: store_atomic_i32_unaligned_release: 258; CHECK: bl __atomic_store 259 store atomic i32 %value, ptr %ptr release, align 1 260 ret void 261} 262 263define dso_local void @store_atomic_i32_unaligned_seq_cst(i32 %value, ptr %ptr) { 264; CHECK-LABEL: store_atomic_i32_unaligned_seq_cst: 265; CHECK: bl __atomic_store 266 store atomic i32 %value, ptr %ptr seq_cst, align 1 267 ret void 268} 269 270define dso_local void @store_atomic_i64_unaligned_unordered(i64 %value, ptr %ptr) { 271; CHECK-LABEL: store_atomic_i64_unaligned_unordered: 272; CHECK: bl __atomic_store 273 store atomic i64 %value, ptr %ptr unordered, align 1 274 ret void 275} 276 277define dso_local void @store_atomic_i64_unaligned_monotonic(i64 %value, ptr %ptr) { 278; CHECK-LABEL: store_atomic_i64_unaligned_monotonic: 279; CHECK: bl __atomic_store 280 store atomic i64 %value, ptr %ptr monotonic, align 1 281 ret void 282} 283 284define dso_local void @store_atomic_i64_unaligned_release(i64 %value, ptr %ptr) { 285; CHECK-LABEL: store_atomic_i64_unaligned_release: 286; CHECK: bl __atomic_store 287 store atomic i64 %value, ptr %ptr release, align 1 288 ret void 289} 290 291define dso_local void @store_atomic_i64_unaligned_seq_cst(i64 %value, ptr %ptr) { 292; CHECK-LABEL: store_atomic_i64_unaligned_seq_cst: 293; CHECK: bl __atomic_store 294 store atomic i64 %value, ptr %ptr seq_cst, align 1 295 ret void 296} 297 298define dso_local void @store_atomic_i128_unaligned_unordered(i128 %value, ptr %ptr) { 299; CHECK-LABEL: store_atomic_i128_unaligned_unordered: 300; CHECK: bl __atomic_store 301 store atomic i128 %value, ptr %ptr unordered, align 1 302 ret void 303} 304 305define dso_local void @store_atomic_i128_unaligned_monotonic(i128 %value, ptr %ptr) { 306; CHECK-LABEL: store_atomic_i128_unaligned_monotonic: 307; CHECK: bl __atomic_store 308 store atomic i128 %value, ptr %ptr monotonic, align 1 309 ret void 310} 311 312define dso_local void @store_atomic_i128_unaligned_release(i128 %value, ptr %ptr) { 313; CHECK-LABEL: store_atomic_i128_unaligned_release: 314; CHECK: bl __atomic_store 315 store atomic i128 %value, ptr %ptr release, align 1 316 ret void 317} 318 319define dso_local void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) { 320; CHECK-LABEL: store_atomic_i128_unaligned_seq_cst: 321; CHECK: bl __atomic_store 322 store atomic i128 %value, ptr %ptr seq_cst, align 1 323 ret void 324} 325