1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
8 ; CHECK-LABEL: name: abs_s32
9 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
10 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
11 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s64)
12 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ASHR]]
13 ; CHECK: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ADD]], [[ASHR]]
14 ; CHECK: $w0 = COPY [[XOR]](s32)
16 %1:_(s32) = G_ABS %0(s32)
24 ; CHECK-LABEL: name: abs_s64
25 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
26 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
27 ; CHECK: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[C]](s64)
28 ; CHECK: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[ASHR]]
29 ; CHECK: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[ADD]], [[ASHR]]
30 ; CHECK: $x0 = COPY [[XOR]](s64)
32 %1:_(s64) = G_ABS %0(s64)
37 tracksRegLiveness: true
42 ; CHECK-LABEL: name: abs_v4s16
44 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
45 ; CHECK: [[ABS:%[0-9]+]]:_(<4 x s16>) = G_ABS [[COPY]]
46 ; CHECK: $d0 = COPY [[ABS]](<4 x s16>)
47 ; CHECK: RET_ReallyLR implicit $d0
48 %0:_(<4 x s16>) = COPY $d0
49 %1:_(<4 x s16>) = G_ABS %0
50 $d0 = COPY %1(<4 x s16>)
51 RET_ReallyLR implicit $d0
56 tracksRegLiveness: true
61 ; CHECK-LABEL: name: abs_v8s16
63 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
64 ; CHECK: [[ABS:%[0-9]+]]:_(<8 x s16>) = G_ABS [[COPY]]
65 ; CHECK: $q0 = COPY [[ABS]](<8 x s16>)
66 ; CHECK: RET_ReallyLR implicit $q0
67 %0:_(<8 x s16>) = COPY $q0
68 %1:_(<8 x s16>) = G_ABS %0
69 $q0 = COPY %1(<8 x s16>)
70 RET_ReallyLR implicit $q0
75 tracksRegLiveness: true
80 ; CHECK-LABEL: name: abs_v2s32
82 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
83 ; CHECK: [[ABS:%[0-9]+]]:_(<2 x s32>) = G_ABS [[COPY]]
84 ; CHECK: $d0 = COPY [[ABS]](<2 x s32>)
85 ; CHECK: RET_ReallyLR implicit $d0
86 %0:_(<2 x s32>) = COPY $d0
87 %1:_(<2 x s32>) = G_ABS %0
88 $d0 = COPY %1(<2 x s32>)
89 RET_ReallyLR implicit $d0
94 tracksRegLiveness: true
99 ; CHECK-LABEL: name: abs_v4s32
100 ; CHECK: liveins: $q0
101 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
102 ; CHECK: [[ABS:%[0-9]+]]:_(<4 x s32>) = G_ABS [[COPY]]
103 ; CHECK: $q0 = COPY [[ABS]](<4 x s32>)
104 ; CHECK: RET_ReallyLR implicit $q0
105 %0:_(<4 x s32>) = COPY $q0
106 %1:_(<4 x s32>) = G_ABS %0
107 $q0 = COPY %1(<4 x s32>)
108 RET_ReallyLR implicit $q0
113 tracksRegLiveness: true
118 ; CHECK-LABEL: name: abs_v4s8
119 ; CHECK: liveins: $d0
120 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
121 ; CHECK: [[ABS:%[0-9]+]]:_(<8 x s8>) = G_ABS [[COPY]]
122 ; CHECK: $d0 = COPY [[ABS]](<8 x s8>)
123 ; CHECK: RET_ReallyLR implicit $d0
124 %0:_(<8 x s8>) = COPY $d0
125 %1:_(<8 x s8>) = G_ABS %0
126 $d0 = COPY %1(<8 x s8>)
127 RET_ReallyLR implicit $d0
132 tracksRegLiveness: true
137 ; CHECK-LABEL: name: abs_v16s8
138 ; CHECK: liveins: $q0
139 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
140 ; CHECK: [[ABS:%[0-9]+]]:_(<16 x s8>) = G_ABS [[COPY]]
141 ; CHECK: $q0 = COPY [[ABS]](<16 x s8>)
142 ; CHECK: RET_ReallyLR implicit $q0
143 %0:_(<16 x s8>) = COPY $q0
144 %1:_(<16 x s8>) = G_ABS %0
145 $q0 = COPY %1(<16 x s8>)
146 RET_ReallyLR implicit $q0