1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=arm64-unknown-unknown -global-isel -run-pass=legalizer -verify-machineinstrs -global-isel-abort=1 %s -o - | FileCheck %s
6 tracksRegLiveness: true
10 ; CHECK-LABEL: name: rotr_s32
11 ; CHECK: liveins: $w0, $w1
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
14 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
15 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
16 ; CHECK-NEXT: %rot:_(s32) = G_ROTR [[COPY]], [[ZEXT]](s64)
17 ; CHECK-NEXT: $w0 = COPY %rot(s32)
18 ; CHECK-NEXT: RET_ReallyLR implicit $w0
21 %rot:_(s32) = G_ROTR %0(s32), %1(s32)
23 RET_ReallyLR implicit $w0
29 tracksRegLiveness: true
33 ; CHECK-LABEL: name: rotr_s64
34 ; CHECK: liveins: $x0, $x1
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
37 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
38 ; CHECK-NEXT: %rot:_(s64) = G_ROTR [[COPY]], [[COPY1]](s64)
39 ; CHECK-NEXT: $x0 = COPY %rot(s64)
40 ; CHECK-NEXT: RET_ReallyLR implicit $x0
43 %rot:_(s64) = G_ROTR %0(s64), %1(s64)
45 RET_ReallyLR implicit $x0
51 tracksRegLiveness: true
55 ; CHECK-LABEL: name: rotl_s32
56 ; CHECK: liveins: $w0, $w1
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
59 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
60 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
61 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY1]]
62 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[SUB]](s32)
63 ; CHECK-NEXT: %rot:_(s32) = G_ROTR [[COPY]], [[ZEXT]](s64)
64 ; CHECK-NEXT: $w0 = COPY %rot(s32)
65 ; CHECK-NEXT: RET_ReallyLR implicit $w0
68 %rot:_(s32) = G_ROTL %0(s32), %1(s32)
70 RET_ReallyLR implicit $w0
76 tracksRegLiveness: true
80 ; CHECK-LABEL: name: rotl_s64
81 ; CHECK: liveins: $x0, $x1
83 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
84 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
85 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
86 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[C]], [[COPY1]]
87 ; CHECK-NEXT: %rot:_(s64) = G_ROTR [[COPY]], [[SUB]](s64)
88 ; CHECK-NEXT: $x0 = COPY %rot(s64)
89 ; CHECK-NEXT: RET_ReallyLR implicit $x0
92 %rot:_(s64) = G_ROTL %0(s64), %1(s64)
94 RET_ReallyLR implicit $x0
100 tracksRegLiveness: true
105 ; CHECK-LABEL: name: test_rotl_v4s32
106 ; CHECK: liveins: $q0, $q1
108 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
109 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
110 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
111 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
112 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
113 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C1]](s32), [[C1]](s32), [[C1]](s32), [[C1]](s32)
114 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(<4 x s32>) = G_SUB [[BUILD_VECTOR]], [[COPY1]]
115 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(<4 x s32>) = G_AND [[COPY1]], [[BUILD_VECTOR1]]
116 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<4 x s32>) = G_SHL [[COPY]], [[AND]](<4 x s32>)
117 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(<4 x s32>) = G_AND [[SUB]], [[BUILD_VECTOR1]]
118 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[COPY]], [[AND1]](<4 x s32>)
119 ; CHECK-NEXT: %rot:_(<4 x s32>) = G_OR [[SHL]], [[LSHR]]
120 ; CHECK-NEXT: $q0 = COPY %rot(<4 x s32>)
121 ; CHECK-NEXT: RET_ReallyLR implicit $q0
122 %0:_(<4 x s32>) = COPY $q0
123 %1:_(<4 x s32>) = COPY $q1
124 %rot:_(<4 x s32>) = G_ROTL %0(<4 x s32>), %1(<4 x s32>)
125 $q0 = COPY %rot(<4 x s32>)
126 RET_ReallyLR implicit $q0
130 name: test_rotr_v4s32
132 tracksRegLiveness: true
137 ; CHECK-LABEL: name: test_rotr_v4s32
138 ; CHECK: liveins: $q0, $q1
140 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
141 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
142 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
143 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
144 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
145 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C1]](s32), [[C1]](s32), [[C1]](s32), [[C1]](s32)
146 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(<4 x s32>) = G_SUB [[BUILD_VECTOR]], [[COPY1]]
147 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(<4 x s32>) = G_AND [[COPY1]], [[BUILD_VECTOR1]]
148 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[COPY]], [[AND]](<4 x s32>)
149 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(<4 x s32>) = G_AND [[SUB]], [[BUILD_VECTOR1]]
150 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<4 x s32>) = G_SHL [[COPY]], [[AND1]](<4 x s32>)
151 ; CHECK-NEXT: %rot:_(<4 x s32>) = G_OR [[LSHR]], [[SHL]]
152 ; CHECK-NEXT: $q0 = COPY %rot(<4 x s32>)
153 ; CHECK-NEXT: RET_ReallyLR implicit $q0
154 %0:_(<4 x s32>) = COPY $q0
155 %1:_(<4 x s32>) = COPY $q1
156 %rot:_(<4 x s32>) = G_ROTR %0(<4 x s32>), %1(<4 x s32>)
157 $q0 = COPY %rot(<4 x s32>)
158 RET_ReallyLR implicit $q0