1 ; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-none-linux-gnu -mattr=+neon -fp-contract=fast | FileCheck %s
3 define float @test_fmul_lane_ss2S(float %a, <2 x float> %v) {
4 ; CHECK-LABEL: test_fmul_lane_ss2S
5 ; CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
6 %tmp1 = extractelement <2 x float> %v, i32 1
7 %tmp2 = fmul float %a, %tmp1;
11 define float @test_fmul_lane_ss2S_swap(float %a, <2 x float> %v) {
12 ; CHECK-LABEL: test_fmul_lane_ss2S_swap
13 ; CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
14 %tmp1 = extractelement <2 x float> %v, i32 1
15 %tmp2 = fmul float %tmp1, %a;
20 define float @test_fmul_lane_ss4S(float %a, <4 x float> %v) {
21 ; CHECK-LABEL: test_fmul_lane_ss4S
22 ; CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
23 %tmp1 = extractelement <4 x float> %v, i32 3
24 %tmp2 = fmul float %a, %tmp1;
28 define float @test_fmul_lane_ss4S_swap(float %a, <4 x float> %v) {
29 ; CHECK-LABEL: test_fmul_lane_ss4S_swap
30 ; CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
31 %tmp1 = extractelement <4 x float> %v, i32 3
32 %tmp2 = fmul float %tmp1, %a;
37 define double @test_fmul_lane_ddD(double %a, <1 x double> %v) {
38 ; CHECK-LABEL: test_fmul_lane_ddD
39 ; CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+.d\[0]|d[0-9]+}}
40 %tmp1 = extractelement <1 x double> %v, i32 0
41 %tmp2 = fmul double %a, %tmp1;
47 define double @test_fmul_lane_dd2D(double %a, <2 x double> %v) {
48 ; CHECK-LABEL: test_fmul_lane_dd2D
49 ; CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
50 %tmp1 = extractelement <2 x double> %v, i32 1
51 %tmp2 = fmul double %a, %tmp1;
56 define double @test_fmul_lane_dd2D_swap(double %a, <2 x double> %v) {
57 ; CHECK-LABEL: test_fmul_lane_dd2D_swap
58 ; CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
59 %tmp1 = extractelement <2 x double> %v, i32 1
60 %tmp2 = fmul double %tmp1, %a;
64 declare float @llvm.aarch64.neon.fmulx.f32(float, float)
66 define float @test_fmulx_lane_f32(float %a, <2 x float> %v) {
67 ; CHECK-LABEL: test_fmulx_lane_f32
68 ; CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
69 %tmp1 = extractelement <2 x float> %v, i32 1
70 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %a, float %tmp1)
74 define float @test_fmulx_laneq_f32(float %a, <4 x float> %v) {
75 ; CHECK-LABEL: test_fmulx_laneq_f32
76 ; CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
77 %tmp1 = extractelement <4 x float> %v, i32 3
78 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %a, float %tmp1)
82 define float @test_fmulx_laneq_f32_swap(float %a, <4 x float> %v) {
83 ; CHECK-LABEL: test_fmulx_laneq_f32_swap
84 ; CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
85 %tmp1 = extractelement <4 x float> %v, i32 3
86 %tmp2 = call float @llvm.aarch64.neon.fmulx.f32(float %tmp1, float %a)
90 declare double @llvm.aarch64.neon.fmulx.f64(double, double)
92 define double @test_fmulx_lane_f64(double %a, <1 x double> %v) {
93 ; CHECK-LABEL: test_fmulx_lane_f64
94 ; CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+.d\[0]|d[0-9]+}}
95 %tmp1 = extractelement <1 x double> %v, i32 0
96 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %a, double %tmp1)
100 define double @test_fmulx_laneq_f64_0(double %a, <2 x double> %v) {
101 ; CHECK-LABEL: test_fmulx_laneq_f64_0
102 ; CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
103 %tmp1 = extractelement <2 x double> %v, i32 0
104 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %a, double %tmp1)
109 define double @test_fmulx_laneq_f64_1(double %a, <2 x double> %v) {
110 ; CHECK-LABEL: test_fmulx_laneq_f64_1
111 ; CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
112 %tmp1 = extractelement <2 x double> %v, i32 1
113 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %a, double %tmp1)
117 define double @test_fmulx_laneq_f64_1_swap(double %a, <2 x double> %v) {
118 ; CHECK-LABEL: test_fmulx_laneq_f64_1_swap
119 ; CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
120 %tmp1 = extractelement <2 x double> %v, i32 1
121 %tmp2 = call double @llvm.aarch64.neon.fmulx.f64(double %tmp1, double %a)