1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -mattr=+lse -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @cmpxchg_i8(i8* %addr) { ret void }
8 define void @cmpxchg_i16(i16* %addr) { ret void }
9 define void @cmpxchg_i32(i32* %addr) { ret void }
10 define void @cmpxchg_i64(i64* %addr) { ret void }
19 ; CHECK-LABEL: name: cmpxchg_i8
20 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
21 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
22 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s32) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: (load store monotonic (s8) on %ir.addr)
23 ; CHECK: $w0 = COPY [[ATOMICRMW_ADD]](s32)
25 %1:_(s8) = G_CONSTANT i8 1
26 %2:_(s8) = G_ATOMICRMW_ADD %0, %1 :: (load store monotonic (s8) on %ir.addr)
27 %3:_(s32) = G_ANYEXT %2
37 ; CHECK-LABEL: name: cmpxchg_i16
38 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
39 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
40 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s32) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: (load store monotonic (s16) on %ir.addr)
41 ; CHECK: $w0 = COPY [[ATOMICRMW_ADD]](s32)
43 %1:_(s16) = G_CONSTANT i16 1
44 %2:_(s16) = G_ATOMICRMW_ADD %0, %1 :: (load store monotonic (s16) on %ir.addr)
45 %3:_(s32) = G_ANYEXT %2
55 ; CHECK-LABEL: name: cmpxchg_i32
56 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
57 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
58 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s32) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: (load store monotonic (s32) on %ir.addr)
59 ; CHECK: $w0 = COPY [[ATOMICRMW_ADD]](s32)
61 %1:_(s32) = G_CONSTANT i32 1
62 %2:_(s32) = G_ATOMICRMW_ADD %0, %1 :: (load store monotonic (s32) on %ir.addr)
72 ; CHECK-LABEL: name: cmpxchg_i64
73 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
74 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
75 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s64) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: (load store monotonic (s64) on %ir.addr)
76 ; CHECK: $x0 = COPY [[ATOMICRMW_ADD]](s64)
78 %1:_(s64) = G_CONSTANT i64 1
79 %2:_(s64) = G_ATOMICRMW_ADD %0, %1 :: (load store monotonic (s64) on %ir.addr)