1 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -asm-verbose=false | FileCheck %s
2 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -asm-verbose=false -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* 2>&1 | FileCheck %s --check-prefixes=CHECK,FALLBACK
4 ; Test efficient codegen of vector extends up from legal type to 128 bit
5 ; and 256 bit vector types.
11 ; FALLBACK-NOT: remark:{{.*}}(in function: func1)
12 define <8 x i16> @func1(<8 x i8> %v0) nounwind {
14 ; CHECK-NEXT: ushll.8h v0, v0, #0
16 %r = zext <8 x i8> %v0 to <8 x i16>
20 ; FALLBACK-NOT: remark:{{.*}}(in function: func2)
21 define <8 x i16> @func2(<8 x i8> %v0) nounwind {
23 ; CHECK-NEXT: sshll.8h v0, v0, #0
25 %r = sext <8 x i8> %v0 to <8 x i16>
29 define <16 x i16> @func3(<16 x i8> %v0) nounwind {
31 ; CHECK-NEXT: ushll2.8h v1, v0, #0
32 ; CHECK-NEXT: ushll.8h v0, v0, #0
34 %r = zext <16 x i8> %v0 to <16 x i16>
38 define <16 x i16> @func4(<16 x i8> %v0) nounwind {
40 ; CHECK-NEXT: sshll2.8h v1, v0, #0
41 ; CHECK-NEXT: sshll.8h v0, v0, #0
43 %r = sext <16 x i8> %v0 to <16 x i16>
51 ; FALLBACK-NOT: remark:{{.*}}(in function: afunc1)
52 define <4 x i32> @afunc1(<4 x i16> %v0) nounwind {
53 ; CHECK-LABEL: afunc1:
54 ; CHECK-NEXT: ushll.4s v0, v0, #0
56 %r = zext <4 x i16> %v0 to <4 x i32>
60 ; FALLBACK-NOT: remark:{{.*}}(in function: afunc2)
61 define <4 x i32> @afunc2(<4 x i16> %v0) nounwind {
62 ; CHECK-LABEL: afunc2:
63 ; CHECK-NEXT: sshll.4s v0, v0, #0
65 %r = sext <4 x i16> %v0 to <4 x i32>
69 define <8 x i32> @afunc3(<8 x i16> %v0) nounwind {
70 ; CHECK-LABEL: afunc3:
71 ; CHECK-NEXT: ushll2.4s v1, v0, #0
72 ; CHECK-NEXT: ushll.4s v0, v0, #0
74 %r = zext <8 x i16> %v0 to <8 x i32>
78 define <8 x i32> @afunc4(<8 x i16> %v0) nounwind {
79 ; CHECK-LABEL: afunc4:
80 ; CHECK-NEXT: sshll2.4s v1, v0, #0
81 ; CHECK-NEXT: sshll.4s v0, v0, #0
83 %r = sext <8 x i16> %v0 to <8 x i32>
87 define <8 x i32> @bfunc1(<8 x i8> %v0) nounwind {
88 ; CHECK-LABEL: bfunc1:
89 ; CHECK-NEXT: ushll.8h v0, v0, #0
90 ; CHECK-NEXT: ushll2.4s v1, v0, #0
91 ; CHECK-NEXT: ushll.4s v0, v0, #0
93 %r = zext <8 x i8> %v0 to <8 x i32>
97 define <8 x i32> @bfunc2(<8 x i8> %v0) nounwind {
98 ; CHECK-LABEL: bfunc2:
99 ; CHECK-NEXT: sshll.8h v0, v0, #0
100 ; CHECK-NEXT: sshll2.4s v1, v0, #0
101 ; CHECK-NEXT: sshll.4s v0, v0, #0
103 %r = sext <8 x i8> %v0 to <8 x i32>
111 define <4 x i64> @zfunc1(<4 x i32> %v0) nounwind {
112 ; CHECK-LABEL: zfunc1:
113 ; CHECK-NEXT: ushll2.2d v1, v0, #0
114 ; CHECK-NEXT: ushll.2d v0, v0, #0
116 %r = zext <4 x i32> %v0 to <4 x i64>
120 define <4 x i64> @zfunc2(<4 x i32> %v0) nounwind {
121 ; CHECK-LABEL: zfunc2:
122 ; CHECK-NEXT: sshll2.2d v1, v0, #0
123 ; CHECK-NEXT: sshll.2d v0, v0, #0
125 %r = sext <4 x i32> %v0 to <4 x i64>
129 define <4 x i64> @bfunc3(<4 x i16> %v0) nounwind {
130 ; CHECK-LABEL: func3:
131 ; CHECK-NEXT: ushll.4s v0, v0, #0
132 ; CHECK-NEXT: ushll2.2d v1, v0, #0
133 ; CHECK-NEXT: ushll.2d v0, v0, #0
135 %r = zext <4 x i16> %v0 to <4 x i64>
139 define <4 x i64> @cfunc4(<4 x i16> %v0) nounwind {
140 ; CHECK-LABEL: func4:
141 ; CHECK-NEXT: sshll.4s v0, v0, #0
142 ; CHECK-NEXT: sshll2.2d v1, v0, #0
143 ; CHECK-NEXT: sshll.2d v0, v0, #0
145 %r = sext <4 x i16> %v0 to <4 x i64>