1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-none-linux-gnu -mattr=+neon -fp-contract=fast | FileCheck %s
4 define float @test_fmul_lane_ss2S_0(float %a, <2 x float> %v) {
5 ; CHECK-LABEL: test_fmul_lane_ss2S_0:
7 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
8 ; CHECK-NEXT: fmul s0, s0, s1
10 %tmp1 = extractelement <2 x float> %v, i32 0
11 %tmp2 = fmul float %a, %tmp1
15 define float @test_fmul_lane_ss2S_1(float %a, <2 x float> %v) {
16 ; CHECK-LABEL: test_fmul_lane_ss2S_1:
18 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
19 ; CHECK-NEXT: fmul s0, s0, v1.s[1]
21 %tmp1 = extractelement <2 x float> %v, i32 1
22 %tmp2 = fmul float %a, %tmp1;
26 define float @test_fmul_lane_ss2S_1_swap(float %a, <2 x float> %v) {
27 ; CHECK-LABEL: test_fmul_lane_ss2S_1_swap:
29 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
30 ; CHECK-NEXT: fmul s0, s0, v1.s[1]
32 %tmp1 = extractelement <2 x float> %v, i32 1
33 %tmp2 = fmul float %tmp1, %a;
37 define float @test_fmul_lane_ss4S_0(float %a, <4 x float> %v) {
38 ; CHECK-LABEL: test_fmul_lane_ss4S_0:
40 ; CHECK-NEXT: fmul s0, s0, s1
42 %tmp1 = extractelement <4 x float> %v, i32 0
43 %tmp2 = fmul float %a, %tmp1
47 define float @test_fmul_lane_ss4S_3(float %a, <4 x float> %v) {
48 ; CHECK-LABEL: test_fmul_lane_ss4S_3:
50 ; CHECK-NEXT: fmul s0, s0, v1.s[3]
52 %tmp1 = extractelement <4 x float> %v, i32 3
53 %tmp2 = fmul float %a, %tmp1;
57 define float @test_fmul_lane_ss4S_3_swap(float %a, <4 x float> %v) {
58 ; CHECK-LABEL: test_fmul_lane_ss4S_3_swap:
60 ; CHECK-NEXT: fmul s0, s0, v1.s[3]
62 %tmp1 = extractelement <4 x float> %v, i32 3
63 %tmp2 = fmul float %tmp1, %a;
68 define double @test_fmul_lane_ddD(double %a, <1 x double> %v) {
69 ; CHECK-LABEL: test_fmul_lane_ddD:
71 ; CHECK-NEXT: fmul d0, d0, d1
73 %tmp1 = extractelement <1 x double> %v, i32 0
74 %tmp2 = fmul double %a, %tmp1;
79 define double @test_fmul_lane_dd2D_0(double %a, <2 x double> %v) {
80 ; CHECK-LABEL: test_fmul_lane_dd2D_0:
82 ; CHECK-NEXT: fmul d0, d0, d1
84 %tmp1 = extractelement <2 x double> %v, i32 0
85 %tmp2 = fmul double %a, %tmp1
89 define double @test_fmul_lane_dd2D_1(double %a, <2 x double> %v) {
90 ; CHECK-LABEL: test_fmul_lane_dd2D_1:
92 ; CHECK-NEXT: fmul d0, d0, v1.d[1]
94 %tmp1 = extractelement <2 x double> %v, i32 1
95 %tmp2 = fmul double %a, %tmp1;
100 define double @test_fmul_lane_dd2D_1_swap(double %a, <2 x double> %v) {
101 ; CHECK-LABEL: test_fmul_lane_dd2D_1_swap:
103 ; CHECK-NEXT: fmul d0, d0, v1.d[1]
105 %tmp1 = extractelement <2 x double> %v, i32 1
106 %tmp2 = fmul double %tmp1, %a;
110 declare float @llvm.aarch64.neon.fmulx.f32(float, float)
112 define float @test_fmulx_lane_f32_0(float %a, <2 x float> %v) {
113 ; CHECK-LABEL: test_fmulx_lane_f32_0:
115 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
116 ; CHECK-NEXT: fmulx s0, s0, s1
118 %tmp1 = extractelement <2 x float> %v, i32 0
119 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %a, float %tmp1)
123 define float @test_fmulx_lane_f32_1(float %a, <2 x float> %v) {
124 ; CHECK-LABEL: test_fmulx_lane_f32_1:
126 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
127 ; CHECK-NEXT: fmulx s0, s0, v1.s[1]
129 %tmp1 = extractelement <2 x float> %v, i32 1
130 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %a, float %tmp1)
134 define float @test_fmulx_laneq_f32_0(float %a, <4 x float> %v) {
135 ; CHECK-LABEL: test_fmulx_laneq_f32_0:
137 ; CHECK-NEXT: fmulx s0, s0, s1
139 %tmp1 = extractelement <4 x float> %v, i32 0
140 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %a, float %tmp1)
144 define float @test_fmulx_laneq_f32_3(float %a, <4 x float> %v) {
145 ; CHECK-LABEL: test_fmulx_laneq_f32_3:
147 ; CHECK-NEXT: fmulx s0, s0, v1.s[3]
149 %tmp1 = extractelement <4 x float> %v, i32 3
150 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %a, float %tmp1)
154 define float @test_fmulx_laneq_f32_3_swap(float %a, <4 x float> %v) {
155 ; CHECK-LABEL: test_fmulx_laneq_f32_3_swap:
157 ; CHECK-NEXT: fmulx s0, s0, v1.s[3]
159 %tmp1 = extractelement <4 x float> %v, i32 3
160 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %tmp1, float %a)
164 declare double @llvm.aarch64.neon.fmulx.f64(double, double)
166 define double @test_fmulx_lane_f64(double %a, <1 x double> %v) {
167 ; CHECK-LABEL: test_fmulx_lane_f64:
169 ; CHECK-NEXT: fmulx d0, d0, d1
171 %tmp1 = extractelement <1 x double> %v, i32 0
172 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %a, double %tmp1)
176 define double @test_fmulx_laneq_f64_0(double %a, <2 x double> %v) {
177 ; CHECK-LABEL: test_fmulx_laneq_f64_0:
179 ; CHECK-NEXT: fmulx d0, d0, d1
181 %tmp1 = extractelement <2 x double> %v, i32 0
182 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %a, double %tmp1)
187 define double @test_fmulx_laneq_f64_1(double %a, <2 x double> %v) {
188 ; CHECK-LABEL: test_fmulx_laneq_f64_1:
190 ; CHECK-NEXT: fmulx d0, d0, v1.d[1]
192 %tmp1 = extractelement <2 x double> %v, i32 1
193 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %a, double %tmp1)
197 define double @test_fmulx_laneq_f64_1_swap(double %a, <2 x double> %v) {
198 ; CHECK-LABEL: test_fmulx_laneq_f64_1_swap:
200 ; CHECK-NEXT: fmulx d0, d0, v1.d[1]
202 %tmp1 = extractelement <2 x double> %v, i32 1
203 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %tmp1, double %a)
207 define float @test_fmulx_horizontal_f32(<2 x float> %v) {
208 ; CHECK-LABEL: test_fmulx_horizontal_f32:
209 ; CHECK: // %bb.0: // %entry
210 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
211 ; CHECK-NEXT: fmulx s0, s0, v0.s[1]
214 %0 = extractelement <2 x float> %v, i32 0
215 %1 = extractelement <2 x float> %v, i32 1
216 %2 = call float @llvm.aarch64.neon.fmulx.f32(float %0, float %1)
220 define double @test_fmulx_horizontal_f64(<2 x double> %v) {
221 ; CHECK-LABEL: test_fmulx_horizontal_f64:
222 ; CHECK: // %bb.0: // %entry
223 ; CHECK-NEXT: fmulx d0, d0, v0.d[1]
226 %0 = extractelement <2 x double> %v, i32 0
227 %1 = extractelement <2 x double> %v, i32 1
228 %2 = call double @llvm.aarch64.neon.fmulx.f64(double %0, double %1)