1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64-linux-gnu -O0 -run-pass=legalizer %s -o - -global-isel-abort=1 | FileCheck %s
3
4---
5name:            test_eve_1
6body: |
7  bb.0:
8    liveins: $q0
9    ; CHECK-LABEL: name: test_eve_1
10    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
11    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
12    ; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[C]](s32)
13    ; CHECK: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<2 x s64>), [[SEXT]](s64)
14    ; CHECK: $x0 = COPY [[EVEC]](s64)
15    ; CHECK: RET_ReallyLR
16    %0:_(<2 x s64>) = COPY $q0
17    %1:_(s32) = G_CONSTANT i32 1
18    %2:_(s64) = G_EXTRACT_VECTOR_ELT %0(<2 x s64>), %1(s32)
19    $x0 = COPY %2(s64)
20    RET_ReallyLR
21...
22---
23name:            test_eve_v2s1
24body: |
25  bb.0:
26    liveins: $q0, $q1, $x0
27    ; CHECK-LABEL: name: test_eve_v2s1
28    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
29    ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
30    ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
31    ; CHECK: [[ICMP:%[0-9]+]]:_(<2 x s64>) = G_ICMP intpred(eq), [[COPY]](<2 x s64>), [[COPY1]]
32    ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY [[ICMP]](<2 x s64>)
33    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
34    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[C]](s64), [[C]](s64)
35    ; CHECK: [[SHL:%[0-9]+]]:_(<2 x s64>) = G_SHL [[COPY3]], [[BUILD_VECTOR]](<2 x s64>)
36    ; CHECK: [[ASHR:%[0-9]+]]:_(<2 x s64>) = G_ASHR [[SHL]], [[BUILD_VECTOR]](<2 x s64>)
37    ; CHECK: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[ASHR]](<2 x s64>), [[COPY2]](s64)
38    ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY [[EVEC]](s64)
39    ; CHECK: $x0 = COPY [[COPY4]](s64)
40    ; CHECK: RET_ReallyLR
41    %0:_(<2 x s64>) = COPY $q0
42    %1:_(<2 x s64>) = COPY $q1
43    %2:_(s64) = COPY $x0
44    %3:_(<2 x s1>) = G_ICMP intpred(eq), %0(<2 x s64>), %1
45    %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<2 x s1>), %2:_(s64)
46    %5:_(s64) = G_ANYEXT %4(s1)
47    $x0 = COPY %5(s64)
48    RET_ReallyLR
49...
50---
51name:            test_eve_v4s1
52body: |
53  bb.0:
54    liveins: $q0, $q1, $x0
55    ; CHECK-LABEL: name: test_eve_v4s1
56    ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
57    ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
58    ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
59    ; CHECK: [[ICMP:%[0-9]+]]:_(<4 x s32>) = G_ICMP intpred(eq), [[COPY]](<4 x s32>), [[COPY1]]
60    ; CHECK: [[COPY3:%[0-9]+]]:_(<4 x s32>) = COPY [[ICMP]](<4 x s32>)
61    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
62    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
63    ; CHECK: [[SHL:%[0-9]+]]:_(<4 x s32>) = G_SHL [[COPY3]], [[BUILD_VECTOR]](<4 x s32>)
64    ; CHECK: [[ASHR:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[SHL]], [[BUILD_VECTOR]](<4 x s32>)
65    ; CHECK: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[ASHR]](<4 x s32>), [[COPY2]](s64)
66    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[EVEC]](s32)
67    ; CHECK: $x0 = COPY [[ANYEXT]](s64)
68    ; CHECK: RET_ReallyLR
69    %0:_(<4 x s32>) = COPY $q0
70    %1:_(<4 x s32>) = COPY $q1
71    %2:_(s64) = COPY $x0
72    %3:_(<4 x s1>) = G_ICMP intpred(eq), %0(<4 x s32>), %1
73    %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<4 x s1>), %2:_(s64)
74    %5:_(s64) = G_ANYEXT %4(s1)
75    $x0 = COPY %5(s64)
76    RET_ReallyLR
77...
78---
79name:            test_eve_v8s1
80body: |
81  bb.0:
82    liveins: $q0, $q1, $x0
83    ; CHECK-LABEL: name: test_eve_v8s1
84    ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
85    ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
86    ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
87    ; CHECK: [[ICMP:%[0-9]+]]:_(<8 x s16>) = G_ICMP intpred(eq), [[COPY]](<8 x s16>), [[COPY1]]
88    ; CHECK: [[COPY3:%[0-9]+]]:_(<8 x s16>) = COPY [[ICMP]](<8 x s16>)
89    ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 15
90    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s16>) = G_BUILD_VECTOR [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16)
91    ; CHECK: [[SHL:%[0-9]+]]:_(<8 x s16>) = G_SHL [[COPY3]], [[BUILD_VECTOR]](<8 x s16>)
92    ; CHECK: [[ASHR:%[0-9]+]]:_(<8 x s16>) = G_ASHR [[SHL]], [[BUILD_VECTOR]](<8 x s16>)
93    ; CHECK: [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[ASHR]](<8 x s16>), [[COPY2]](s64)
94    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[EVEC]](s16)
95    ; CHECK: $x0 = COPY [[ANYEXT]](s64)
96    ; CHECK: RET_ReallyLR
97    %0:_(<8 x s16>) = COPY $q0
98    %1:_(<8 x s16>) = COPY $q1
99    %2:_(s64) = COPY $x0
100    %3:_(<8 x s1>) = G_ICMP intpred(eq), %0(<8 x s16>), %1
101    %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<8 x s1>), %2:_(s64)
102    %5:_(s64) = G_ANYEXT %4(s1)
103    $x0 = COPY %5(s64)
104    RET_ReallyLR
105...
106---
107name:            test_eve_v16s1
108body: |
109  bb.0:
110    liveins: $q0, $q1, $x0
111    ; CHECK-LABEL: name: test_eve_v16s1
112    ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
113    ; CHECK: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
114    ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
115    ; CHECK: [[ICMP:%[0-9]+]]:_(<16 x s8>) = G_ICMP intpred(eq), [[COPY]](<16 x s8>), [[COPY1]]
116    ; CHECK: [[COPY3:%[0-9]+]]:_(<16 x s8>) = COPY [[ICMP]](<16 x s8>)
117    ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 7
118    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<16 x s8>) = G_BUILD_VECTOR [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8), [[C]](s8)
119    ; CHECK: [[SHL:%[0-9]+]]:_(<16 x s8>) = G_SHL [[COPY3]], [[BUILD_VECTOR]](<16 x s8>)
120    ; CHECK: [[ASHR:%[0-9]+]]:_(<16 x s8>) = G_ASHR [[SHL]], [[BUILD_VECTOR]](<16 x s8>)
121    ; CHECK: [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[ASHR]](<16 x s8>), [[COPY2]](s64)
122    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[EVEC]](s8)
123    ; CHECK: $x0 = COPY [[ANYEXT]](s64)
124    ; CHECK: RET_ReallyLR
125    %0:_(<16 x s8>) = COPY $q0
126    %1:_(<16 x s8>) = COPY $q1
127    %2:_(s64) = COPY $x0
128    %3:_(<16 x s1>) = G_ICMP intpred(eq), %0(<16 x s8>), %1
129    %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<16 x s1>), %2:_(s64)
130    %5:_(s64) = G_ANYEXT %4(s1)
131    $x0 = COPY %5(s64)
132    RET_ReallyLR
133...
134---
135name:            test_eve_v2p0
136body: |
137  bb.0:
138    liveins: $q0, $q1, $x0
139    ; CHECK-LABEL: name: test_eve_v2p0
140    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $q0
141    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x0
142    ; CHECK: [[EVEC:%[0-9]+]]:_(p0) = G_EXTRACT_VECTOR_ELT [[COPY]](<2 x p0>), [[COPY1]](s64)
143    ; CHECK: $x0 = COPY [[EVEC]](p0)
144    ; CHECK: RET_ReallyLR
145    %0:_(<2 x p0>) = COPY $q0
146    %2:_(s64) = COPY $x0
147    %3:_(p0) = G_EXTRACT_VECTOR_ELT %0:_(<2 x p0>), %2:_(s64)
148    $x0 = COPY %3(p0)
149    RET_ReallyLR
150...
151