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=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O0 4; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -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: bl __aarch64_cas16_relax 121; -O0: eor x8, x0, x8 122; -O0: eor x9, x1, x9 123; -O0: orr x8, x8, x9 124; -O0: subs x8, x8, #0 125; 126; -O1-LABEL: store_atomic_i128_aligned_unordered: 127; -O1: ldxp xzr, x8, [x2] 128; -O1: stxp w8, x0, x1, [x2] 129 store atomic i128 %value, ptr %ptr unordered, align 16 130 ret void 131} 132 133define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) { 134; -O0-LABEL: store_atomic_i128_aligned_monotonic: 135; -O0: bl __aarch64_cas16_relax 136; -O0: eor x8, x0, x8 137; -O0: eor x9, x1, x9 138; -O0: orr x8, x8, x9 139; -O0: subs x8, x8, #0 140; 141; -O1-LABEL: store_atomic_i128_aligned_monotonic: 142; -O1: ldxp xzr, x8, [x2] 143; -O1: stxp w8, x0, x1, [x2] 144 store atomic i128 %value, ptr %ptr monotonic, align 16 145 ret void 146} 147 148define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) { 149; -O0-LABEL: store_atomic_i128_aligned_release: 150; -O0: bl __aarch64_cas16_rel 151; -O0: eor x8, x0, x8 152; -O0: eor x9, x1, x9 153; -O0: orr x8, x8, x9 154; -O0: subs x8, x8, #0 155; 156; -O1-LABEL: store_atomic_i128_aligned_release: 157; -O1: ldxp xzr, x8, [x2] 158; -O1: stlxp w8, x0, x1, [x2] 159 store atomic i128 %value, ptr %ptr release, align 16 160 ret void 161} 162 163define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) { 164; -O0-LABEL: store_atomic_i128_aligned_seq_cst: 165; -O0: bl __aarch64_cas16_acq_rel 166; -O0: eor x8, x0, x8 167; -O0: eor x9, x1, x9 168; -O0: orr x8, x8, x9 169; -O0: subs x8, x8, #0 170; 171; -O1-LABEL: store_atomic_i128_aligned_seq_cst: 172; -O1: ldaxp xzr, x8, [x2] 173; -O1: stlxp w8, x0, x1, [x2] 174 store atomic i128 %value, ptr %ptr seq_cst, align 16 175 ret void 176} 177 178define dso_local void @store_atomic_i8_unaligned_unordered(i8 %value, ptr %ptr) { 179; CHECK-LABEL: store_atomic_i8_unaligned_unordered: 180; CHECK: strb w0, [x1] 181 store atomic i8 %value, ptr %ptr unordered, align 1 182 ret void 183} 184 185define dso_local void @store_atomic_i8_unaligned_monotonic(i8 %value, ptr %ptr) { 186; CHECK-LABEL: store_atomic_i8_unaligned_monotonic: 187; CHECK: strb w0, [x1] 188 store atomic i8 %value, ptr %ptr monotonic, align 1 189 ret void 190} 191 192define dso_local void @store_atomic_i8_unaligned_release(i8 %value, ptr %ptr) { 193; CHECK-LABEL: store_atomic_i8_unaligned_release: 194; CHECK: stlrb w0, [x1] 195 store atomic i8 %value, ptr %ptr release, align 1 196 ret void 197} 198 199define dso_local void @store_atomic_i8_unaligned_seq_cst(i8 %value, ptr %ptr) { 200; CHECK-LABEL: store_atomic_i8_unaligned_seq_cst: 201; CHECK: stlrb w0, [x1] 202 store atomic i8 %value, ptr %ptr seq_cst, align 1 203 ret void 204} 205 206define dso_local void @store_atomic_i16_unaligned_unordered(i16 %value, ptr %ptr) { 207; CHECK-LABEL: store_atomic_i16_unaligned_unordered: 208; CHECK: bl __atomic_store 209 store atomic i16 %value, ptr %ptr unordered, align 1 210 ret void 211} 212 213define dso_local void @store_atomic_i16_unaligned_monotonic(i16 %value, ptr %ptr) { 214; CHECK-LABEL: store_atomic_i16_unaligned_monotonic: 215; CHECK: bl __atomic_store 216 store atomic i16 %value, ptr %ptr monotonic, align 1 217 ret void 218} 219 220define dso_local void @store_atomic_i16_unaligned_release(i16 %value, ptr %ptr) { 221; CHECK-LABEL: store_atomic_i16_unaligned_release: 222; CHECK: bl __atomic_store 223 store atomic i16 %value, ptr %ptr release, align 1 224 ret void 225} 226 227define dso_local void @store_atomic_i16_unaligned_seq_cst(i16 %value, ptr %ptr) { 228; CHECK-LABEL: store_atomic_i16_unaligned_seq_cst: 229; CHECK: bl __atomic_store 230 store atomic i16 %value, ptr %ptr seq_cst, align 1 231 ret void 232} 233 234define dso_local void @store_atomic_i32_unaligned_unordered(i32 %value, ptr %ptr) { 235; CHECK-LABEL: store_atomic_i32_unaligned_unordered: 236; CHECK: bl __atomic_store 237 store atomic i32 %value, ptr %ptr unordered, align 1 238 ret void 239} 240 241define dso_local void @store_atomic_i32_unaligned_monotonic(i32 %value, ptr %ptr) { 242; CHECK-LABEL: store_atomic_i32_unaligned_monotonic: 243; CHECK: bl __atomic_store 244 store atomic i32 %value, ptr %ptr monotonic, align 1 245 ret void 246} 247 248define dso_local void @store_atomic_i32_unaligned_release(i32 %value, ptr %ptr) { 249; CHECK-LABEL: store_atomic_i32_unaligned_release: 250; CHECK: bl __atomic_store 251 store atomic i32 %value, ptr %ptr release, align 1 252 ret void 253} 254 255define dso_local void @store_atomic_i32_unaligned_seq_cst(i32 %value, ptr %ptr) { 256; CHECK-LABEL: store_atomic_i32_unaligned_seq_cst: 257; CHECK: bl __atomic_store 258 store atomic i32 %value, ptr %ptr seq_cst, align 1 259 ret void 260} 261 262define dso_local void @store_atomic_i64_unaligned_unordered(i64 %value, ptr %ptr) { 263; CHECK-LABEL: store_atomic_i64_unaligned_unordered: 264; CHECK: bl __atomic_store 265 store atomic i64 %value, ptr %ptr unordered, align 1 266 ret void 267} 268 269define dso_local void @store_atomic_i64_unaligned_monotonic(i64 %value, ptr %ptr) { 270; CHECK-LABEL: store_atomic_i64_unaligned_monotonic: 271; CHECK: bl __atomic_store 272 store atomic i64 %value, ptr %ptr monotonic, align 1 273 ret void 274} 275 276define dso_local void @store_atomic_i64_unaligned_release(i64 %value, ptr %ptr) { 277; CHECK-LABEL: store_atomic_i64_unaligned_release: 278; CHECK: bl __atomic_store 279 store atomic i64 %value, ptr %ptr release, align 1 280 ret void 281} 282 283define dso_local void @store_atomic_i64_unaligned_seq_cst(i64 %value, ptr %ptr) { 284; CHECK-LABEL: store_atomic_i64_unaligned_seq_cst: 285; CHECK: bl __atomic_store 286 store atomic i64 %value, ptr %ptr seq_cst, align 1 287 ret void 288} 289 290define dso_local void @store_atomic_i128_unaligned_unordered(i128 %value, ptr %ptr) { 291; CHECK-LABEL: store_atomic_i128_unaligned_unordered: 292; CHECK: bl __atomic_store 293 store atomic i128 %value, ptr %ptr unordered, align 1 294 ret void 295} 296 297define dso_local void @store_atomic_i128_unaligned_monotonic(i128 %value, ptr %ptr) { 298; CHECK-LABEL: store_atomic_i128_unaligned_monotonic: 299; CHECK: bl __atomic_store 300 store atomic i128 %value, ptr %ptr monotonic, align 1 301 ret void 302} 303 304define dso_local void @store_atomic_i128_unaligned_release(i128 %value, ptr %ptr) { 305; CHECK-LABEL: store_atomic_i128_unaligned_release: 306; CHECK: bl __atomic_store 307 store atomic i128 %value, ptr %ptr release, align 1 308 ret void 309} 310 311define dso_local void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) { 312; CHECK-LABEL: store_atomic_i128_unaligned_seq_cst: 313; CHECK: bl __atomic_store 314 store atomic i128 %value, ptr %ptr seq_cst, align 1 315 ret void 316} 317