2014-05-24 20:50:23 +08:00
|
|
|
; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon -fp-contract=fast | FileCheck %s
|
2013-11-16 07:32:10 +08:00
|
|
|
|
|
|
|
declare float @llvm.fma.f32(float, float, float)
|
|
|
|
declare double @llvm.fma.f64(double, double, double)
|
|
|
|
|
|
|
|
define float @test_fmla_ss4S(float %a, float %b, <4 x float> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmla_ss4S
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmla {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <4 x float> %v, i32 3
|
|
|
|
%tmp2 = call float @llvm.fma.f32(float %b, float %tmp1, float %a)
|
|
|
|
ret float %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test_fmla_ss4S_swap(float %a, float %b, <4 x float> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmla_ss4S_swap
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmla {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <4 x float> %v, i32 3
|
|
|
|
%tmp2 = call float @llvm.fma.f32(float %tmp1, float %a, float %a)
|
|
|
|
ret float %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test_fmla_ss2S(float %a, float %b, <2 x float> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmla_ss2S
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmla {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <2 x float> %v, i32 1
|
|
|
|
%tmp2 = call float @llvm.fma.f32(float %b, float %tmp1, float %a)
|
|
|
|
ret float %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_fmla_ddD(double %a, double %b, <1 x double> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmla_ddD
|
|
|
|
; CHECK: {{fmla d[0-9]+, d[0-9]+, v[0-9]+.d\[0]|fmadd d[0-9]+, d[0-9]+, d[0-9]+, d[0-9]+}}
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <1 x double> %v, i32 0
|
|
|
|
%tmp2 = call double @llvm.fma.f64(double %b, double %tmp1, double %a)
|
|
|
|
ret double %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_fmla_dd2D(double %a, double %b, <2 x double> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmla_dd2D
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <2 x double> %v, i32 1
|
|
|
|
%tmp2 = call double @llvm.fma.f64(double %b, double %tmp1, double %a)
|
|
|
|
ret double %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_fmla_dd2D_swap(double %a, double %b, <2 x double> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmla_dd2D_swap
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <2 x double> %v, i32 1
|
|
|
|
%tmp2 = call double @llvm.fma.f64(double %tmp1, double %b, double %a)
|
|
|
|
ret double %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test_fmls_ss4S(float %a, float %b, <4 x float> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmls_ss4S
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmls {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <4 x float> %v, i32 3
|
|
|
|
%tmp2 = fsub float -0.0, %tmp1
|
|
|
|
%tmp3 = call float @llvm.fma.f32(float %tmp2, float %tmp1, float %a)
|
|
|
|
ret float %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test_fmls_ss4S_swap(float %a, float %b, <4 x float> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmls_ss4S_swap
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmls {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <4 x float> %v, i32 3
|
|
|
|
%tmp2 = fsub float -0.0, %tmp1
|
|
|
|
%tmp3 = call float @llvm.fma.f32(float %tmp1, float %tmp2, float %a)
|
|
|
|
ret float %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
define float @test_fmls_ss2S(float %a, float %b, <2 x float> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmls_ss2S
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmls {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <2 x float> %v, i32 1
|
|
|
|
%tmp2 = fsub float -0.0, %tmp1
|
|
|
|
%tmp3 = call float @llvm.fma.f32(float %tmp2, float %tmp1, float %a)
|
|
|
|
ret float %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_fmls_ddD(double %a, double %b, <1 x double> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmls_ddD
|
|
|
|
; CHECK: {{fmls d[0-9]+, d[0-9]+, v[0-9]+.d\[0]|fmsub d[0-9]+, d[0-9]+, d[0-9]+, d[0-9]+}}
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <1 x double> %v, i32 0
|
|
|
|
%tmp2 = fsub double -0.0, %tmp1
|
|
|
|
%tmp3 = call double @llvm.fma.f64(double %tmp2, double %tmp1, double %a)
|
|
|
|
ret double %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_fmls_dd2D(double %a, double %b, <2 x double> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmls_dd2D
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmls {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <2 x double> %v, i32 1
|
|
|
|
%tmp2 = fsub double -0.0, %tmp1
|
|
|
|
%tmp3 = call double @llvm.fma.f64(double %tmp2, double %tmp1, double %a)
|
|
|
|
ret double %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_fmls_dd2D_swap(double %a, double %b, <2 x double> %v) {
|
2014-04-22 18:10:26 +08:00
|
|
|
; CHECK-LABEL: test_fmls_dd2D_swap
|
2013-12-12 10:19:13 +08:00
|
|
|
; CHECK: fmls {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
|
2013-11-16 07:32:10 +08:00
|
|
|
%tmp1 = extractelement <2 x double> %v, i32 1
|
|
|
|
%tmp2 = fsub double -0.0, %tmp1
|
|
|
|
%tmp3 = call double @llvm.fma.f64(double %tmp1, double %tmp2, double %a)
|
|
|
|
ret double %tmp3
|
|
|
|
}
|
|
|
|
|