1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
10 define half @extractelement_v2f16(<2 x half> %op1) {
11 ; CHECK-LABEL: extractelement_v2f16:
13 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
14 ; CHECK-NEXT: mov z0.h, z0.h[1]
15 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $z0
17 %r = extractelement <2 x half> %op1, i64 1
21 define half @extractelement_v4f16(<4 x half> %op1) {
22 ; CHECK-LABEL: extractelement_v4f16:
24 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
25 ; CHECK-NEXT: mov z0.h, z0.h[3]
26 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $z0
28 %r = extractelement <4 x half> %op1, i64 3
32 define half @extractelement_v8f16(<8 x half> %op1) {
33 ; CHECK-LABEL: extractelement_v8f16:
35 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
36 ; CHECK-NEXT: mov z0.h, z0.h[7]
37 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $z0
39 %r = extractelement <8 x half> %op1, i64 7
43 define half @extractelement_v16f16(ptr %a) {
44 ; CHECK-LABEL: extractelement_v16f16:
46 ; CHECK-NEXT: ldr q0, [x0, #16]
47 ; CHECK-NEXT: mov z0.h, z0.h[7]
48 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $z0
50 %op1 = load <16 x half>, ptr %a
51 %r = extractelement <16 x half> %op1, i64 15
55 define float @extractelement_v2f32(<2 x float> %op1) {
56 ; CHECK-LABEL: extractelement_v2f32:
58 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
59 ; CHECK-NEXT: mov z0.s, z0.s[1]
60 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $z0
62 %r = extractelement <2 x float> %op1, i64 1
66 define float @extractelement_v4f32(<4 x float> %op1) {
67 ; CHECK-LABEL: extractelement_v4f32:
69 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
70 ; CHECK-NEXT: mov z0.s, z0.s[3]
71 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $z0
73 %r = extractelement <4 x float> %op1, i64 3
77 define float @extractelement_v8f32(ptr %a) {
78 ; CHECK-LABEL: extractelement_v8f32:
80 ; CHECK-NEXT: ldr q0, [x0, #16]
81 ; CHECK-NEXT: mov z0.s, z0.s[3]
82 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $z0
84 %op1 = load <8 x float>, ptr %a
85 %r = extractelement <8 x float> %op1, i64 7
89 define double @extractelement_v1f64(<1 x double> %op1) {
90 ; CHECK-LABEL: extractelement_v1f64:
92 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
93 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
95 %r = extractelement <1 x double> %op1, i64 0
98 define double @extractelement_v2f64(<2 x double> %op1) {
99 ; CHECK-LABEL: extractelement_v2f64:
101 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
102 ; CHECK-NEXT: mov z0.d, z0.d[1]
103 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
105 %r = extractelement <2 x double> %op1, i64 1
109 define double @extractelement_v4f64(ptr %a) {
110 ; CHECK-LABEL: extractelement_v4f64:
112 ; CHECK-NEXT: ldr q0, [x0, #16]
113 ; CHECK-NEXT: mov z0.d, z0.d[1]
114 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
116 %op1 = load <4 x double>, ptr %a
117 %r = extractelement <4 x double> %op1, i64 3