1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
6 define i32 @i8_i32(<vscale x 16 x i8> %a) #0 {
8 ; CHECK: // %bb.0: // %entry
9 ; CHECK-NEXT: smov w0, v0.b[15]
12 %elt = extractelement <vscale x 16 x i8> %a, i32 15
13 %conv = sext i8 %elt to i32
17 define i64 @i8_i64(<vscale x 16 x i8> %a) #0 {
18 ; CHECK-LABEL: i8_i64:
19 ; CHECK: // %bb.0: // %entry
20 ; CHECK-NEXT: smov x0, v0.b[15]
23 %elt = extractelement <vscale x 16 x i8> %a, i32 15
24 %conv = sext i8 %elt to i64
28 define i32 @i16_i32(<vscale x 8 x i16> %a) #0 {
29 ; CHECK-LABEL: i16_i32:
30 ; CHECK: // %bb.0: // %entry
31 ; CHECK-NEXT: smov w0, v0.h[7]
34 %elt = extractelement <vscale x 8 x i16> %a, i32 7
35 %conv = sext i16 %elt to i32
39 define i64 @i16_i64(<vscale x 8 x i16> %a) #0 {
40 ; CHECK-LABEL: i16_i64:
41 ; CHECK: // %bb.0: // %entry
42 ; CHECK-NEXT: smov x0, v0.h[7]
45 %elt = extractelement <vscale x 8 x i16> %a, i32 7
46 %conv = sext i16 %elt to i64
50 define i64 @i32_i64(<vscale x 4 x i32> %a) #0 {
51 ; CHECK-LABEL: i32_i64:
52 ; CHECK: // %bb.0: // %entry
53 ; CHECK-NEXT: smov x0, v0.s[3]
56 %elt = extractelement <vscale x 4 x i32> %a, i32 3
57 %conv = sext i32 %elt to i64
61 ; NOTE: Testing out-of-range indices
63 define i32 @i8_i32_oor(<vscale x 16 x i8> %a) #0 {
64 ; CHECK-LABEL: i8_i32_oor:
65 ; CHECK: // %bb.0: // %entry
66 ; CHECK-NEXT: mov z0.b, z0.b[16]
67 ; CHECK-NEXT: fmov w8, s0
68 ; CHECK-NEXT: sxtb w0, w8
71 %elt = extractelement <vscale x 16 x i8> %a, i32 16
72 %conv = sext i8 %elt to i32
76 define i64 @i8_i64_oor(<vscale x 16 x i8> %a) #0 {
77 ; CHECK-LABEL: i8_i64_oor:
78 ; CHECK: // %bb.0: // %entry
79 ; CHECK-NEXT: mov z0.b, z0.b[16]
80 ; CHECK-NEXT: fmov w8, s0
81 ; CHECK-NEXT: sxtb x0, w8
84 %elt = extractelement <vscale x 16 x i8> %a, i32 16
85 %conv = sext i8 %elt to i64
89 define i32 @i16_i32_oor(<vscale x 8 x i16> %a) #0 {
90 ; CHECK-LABEL: i16_i32_oor:
91 ; CHECK: // %bb.0: // %entry
92 ; CHECK-NEXT: mov z0.h, z0.h[8]
93 ; CHECK-NEXT: fmov w8, s0
94 ; CHECK-NEXT: sxth w0, w8
97 %elt = extractelement <vscale x 8 x i16> %a, i32 8
98 %conv = sext i16 %elt to i32
102 define i64 @i16_i64_oor(<vscale x 8 x i16> %a) #0 {
103 ; CHECK-LABEL: i16_i64_oor:
104 ; CHECK: // %bb.0: // %entry
105 ; CHECK-NEXT: mov z0.h, z0.h[8]
106 ; CHECK-NEXT: fmov w8, s0
107 ; CHECK-NEXT: sxth x0, w8
110 %elt = extractelement <vscale x 8 x i16> %a, i32 8
111 %conv = sext i16 %elt to i64
115 define i64 @i32_i64_oor(<vscale x 4 x i32> %a) #0 {
116 ; CHECK-LABEL: i32_i64_oor:
117 ; CHECK: // %bb.0: // %entry
118 ; CHECK-NEXT: mov z0.s, z0.s[4]
119 ; CHECK-NEXT: fmov w8, s0
120 ; CHECK-NEXT: sxtw x0, w8
123 %elt = extractelement <vscale x 4 x i32> %a, i32 4
124 %conv = sext i32 %elt to i64
128 attributes #0 = { "target-features"="+sve" }