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
12 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
13 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
14 ; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY1]](s32)
15 ; CHECK: %rot:_(s32) = G_ROTR [[COPY]], [[SEXT]](s64)
16 ; CHECK: $w0 = COPY %rot(s32)
17 ; CHECK: RET_ReallyLR implicit $w0
20 %rot:_(s32) = G_ROTR %0(s32), %1(s32)
22 RET_ReallyLR implicit $w0
28 tracksRegLiveness: true
32 ; CHECK-LABEL: name: rotr_s64
33 ; CHECK: liveins: $x0, $x1
34 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
35 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
36 ; CHECK: %rot:_(s64) = G_ROTR [[COPY]], [[COPY1]](s64)
37 ; CHECK: $x0 = COPY %rot(s64)
38 ; CHECK: RET_ReallyLR implicit $x0
41 %rot:_(s64) = G_ROTR %0(s64), %1(s64)
43 RET_ReallyLR implicit $x0
49 tracksRegLiveness: true
53 ; CHECK-LABEL: name: rotl_s32
54 ; CHECK: liveins: $w0, $w1
55 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
56 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
57 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
58 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY1]]
59 ; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SUB]](s32)
60 ; CHECK: %rot:_(s32) = G_ROTR [[COPY]], [[SEXT]](s64)
61 ; CHECK: $w0 = COPY %rot(s32)
62 ; CHECK: RET_ReallyLR implicit $w0
65 %rot:_(s32) = G_ROTL %0(s32), %1(s32)
67 RET_ReallyLR implicit $w0
73 tracksRegLiveness: true
77 ; CHECK-LABEL: name: rotl_s64
78 ; CHECK: liveins: $x0, $x1
79 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
80 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
81 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
82 ; CHECK: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[C]], [[COPY1]]
83 ; CHECK: %rot:_(s64) = G_ROTR [[COPY]], [[SUB]](s64)
84 ; CHECK: $x0 = COPY %rot(s64)
85 ; CHECK: RET_ReallyLR implicit $x0
88 %rot:_(s64) = G_ROTL %0(s64), %1(s64)
90 RET_ReallyLR implicit $x0
96 tracksRegLiveness: true
101 ; CHECK-LABEL: name: test_rotl_v4s32
102 ; CHECK: liveins: $q0, $q1
103 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
104 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
105 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
106 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
107 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
108 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C1]](s32), [[C1]](s32), [[C1]](s32), [[C1]](s32)
109 ; CHECK: [[SUB:%[0-9]+]]:_(<4 x s32>) = G_SUB [[BUILD_VECTOR]], [[COPY1]]
110 ; CHECK: [[AND:%[0-9]+]]:_(<4 x s32>) = G_AND [[COPY1]], [[BUILD_VECTOR1]]
111 ; CHECK: [[SHL:%[0-9]+]]:_(<4 x s32>) = G_SHL [[COPY]], [[AND]](<4 x s32>)
112 ; CHECK: [[AND1:%[0-9]+]]:_(<4 x s32>) = G_AND [[SUB]], [[BUILD_VECTOR1]]
113 ; CHECK: [[LSHR:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[COPY]], [[AND1]](<4 x s32>)
114 ; CHECK: %rot:_(<4 x s32>) = G_OR [[SHL]], [[LSHR]]
115 ; CHECK: $q0 = COPY %rot(<4 x s32>)
116 ; CHECK: RET_ReallyLR implicit $q0
117 %0:_(<4 x s32>) = COPY $q0
118 %1:_(<4 x s32>) = COPY $q1
119 %rot:_(<4 x s32>) = G_ROTL %0(<4 x s32>), %1(<4 x s32>)
120 $q0 = COPY %rot(<4 x s32>)
121 RET_ReallyLR implicit $q0
125 name: test_rotr_v4s32
127 tracksRegLiveness: true
132 ; CHECK-LABEL: name: test_rotr_v4s32
133 ; CHECK: liveins: $q0, $q1
134 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
135 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
136 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
137 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
138 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
139 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C1]](s32), [[C1]](s32), [[C1]](s32), [[C1]](s32)
140 ; CHECK: [[SUB:%[0-9]+]]:_(<4 x s32>) = G_SUB [[BUILD_VECTOR]], [[COPY1]]
141 ; CHECK: [[AND:%[0-9]+]]:_(<4 x s32>) = G_AND [[COPY1]], [[BUILD_VECTOR1]]
142 ; CHECK: [[LSHR:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[COPY]], [[AND]](<4 x s32>)
143 ; CHECK: [[AND1:%[0-9]+]]:_(<4 x s32>) = G_AND [[SUB]], [[BUILD_VECTOR1]]
144 ; CHECK: [[SHL:%[0-9]+]]:_(<4 x s32>) = G_SHL [[COPY]], [[AND1]](<4 x s32>)
145 ; CHECK: %rot:_(<4 x s32>) = G_OR [[LSHR]], [[SHL]]
146 ; CHECK: $q0 = COPY %rot(<4 x s32>)
147 ; CHECK: RET_ReallyLR implicit $q0
148 %0:_(<4 x s32>) = COPY $q0
149 %1:_(<4 x s32>) = COPY $q1
150 %rot:_(<4 x s32>) = G_ROTR %0(<4 x s32>), %1(<4 x s32>)
151 $q0 = COPY %rot(<4 x s32>)
152 RET_ReallyLR implicit $q0