317 lines · plain
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.py3; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O04; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -O1 | FileCheck %s --check-prefixes=CHECK,-O15 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 110 ret void11}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 117 ret void18}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 124 ret void25}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 131 ret void32}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 238 ret void39}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 245 ret void46}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 252 ret void53}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 259 ret void60}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 466 ret void67}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 473 ret void74}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 480 ret void81}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 487 ret void88}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 894 ret void95}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 8101 ret void102}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 8108 ret void109}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 8115 ret void116}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_relax121; -O0: eor x8, x0, x8122; -O0: eor x9, x1, x9123; -O0: orr x8, x8, x9124; -O0: subs x8, x8, #0125;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 16130 ret void131}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_relax136; -O0: eor x8, x0, x8137; -O0: eor x9, x1, x9138; -O0: orr x8, x8, x9139; -O0: subs x8, x8, #0140;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 16145 ret void146}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_rel151; -O0: eor x8, x0, x8152; -O0: eor x9, x1, x9153; -O0: orr x8, x8, x9154; -O0: subs x8, x8, #0155;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 16160 ret void161}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_rel166; -O0: eor x8, x0, x8167; -O0: eor x9, x1, x9168; -O0: orr x8, x8, x9169; -O0: subs x8, x8, #0170;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 16175 ret void176}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 1182 ret void183}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 1189 ret void190}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 1196 ret void197}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 1203 ret void204}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_store209 store atomic i16 %value, ptr %ptr unordered, align 1210 ret void211}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_store216 store atomic i16 %value, ptr %ptr monotonic, align 1217 ret void218}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_store223 store atomic i16 %value, ptr %ptr release, align 1224 ret void225}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_store230 store atomic i16 %value, ptr %ptr seq_cst, align 1231 ret void232}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_store237 store atomic i32 %value, ptr %ptr unordered, align 1238 ret void239}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_store244 store atomic i32 %value, ptr %ptr monotonic, align 1245 ret void246}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_store251 store atomic i32 %value, ptr %ptr release, align 1252 ret void253}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_store258 store atomic i32 %value, ptr %ptr seq_cst, align 1259 ret void260}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_store265 store atomic i64 %value, ptr %ptr unordered, align 1266 ret void267}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_store272 store atomic i64 %value, ptr %ptr monotonic, align 1273 ret void274}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_store279 store atomic i64 %value, ptr %ptr release, align 1280 ret void281}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_store286 store atomic i64 %value, ptr %ptr seq_cst, align 1287 ret void288}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_store293 store atomic i128 %value, ptr %ptr unordered, align 1294 ret void295}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_store300 store atomic i128 %value, ptr %ptr monotonic, align 1301 ret void302}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_store307 store atomic i128 %value, ptr %ptr release, align 1308 ret void309}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_store314 store atomic i128 %value, ptr %ptr seq_cst, align 1315 ret void316}317