blob: 618dbebcce91451b149e693df4a73e421ccb9ae6 [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=arm-eabi -mattr=+v6,+vfp2 %s -o - | FileCheck %s
define double @t1(double %a, double %b) {
; CHECK-LABEL: t1:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov d0, r2, r3
; CHECK-NEXT: vmov d1, r0, r1
; CHECK-NEXT: vnmul.f64 d0, d1, d0
; CHECK-NEXT: vmov r0, r1, d0
; CHECK-NEXT: bx lr
entry:
%tmp2 = fsub double -0.000000e+00, %a
%tmp4 = fmul double %tmp2, %b
ret double %tmp4
}
define double @tfast(double %a, double %b) {
; CHECK-LABEL: tfast:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vmov d0, r2, r3
; CHECK-NEXT: vmov d1, r0, r1
; CHECK-NEXT: vnmul.f64 d0, d1, d0
; CHECK-NEXT: vmov r0, r1, d0
; CHECK-NEXT: bx lr
entry:
%tmp2 = fsub fast double -0.000000e+00, %a
%tmp4 = fmul fast double %tmp2, %b
ret double %tmp4
}
define arm_aapcs_vfpcc float @t1_f32(float %a, float %b) {
; CHECK-LABEL: t1_f32:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vnmul.f32 s0, s0, s1
; CHECK-NEXT: bx lr
entry:
%tmp2 = fneg float %a
%tmp4 = fmul float %tmp2, %b
ret float %tmp4
}
; The reassociated fold requires the default FP environment, so the constrained
; nodes of a strictfp function do not select VNMUL.
define arm_aapcs_vfpcc float @t1_f32_strictfp(float %a, float %b) strictfp {
; CHECK-LABEL: t1_f32_strictfp:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: vneg.f32 s0, s0
; CHECK-NEXT: vmul.f32 s0, s0, s1
; CHECK-NEXT: bx lr
entry:
%tmp2 = fneg float %a
%tmp4 = call float @llvm.experimental.constrained.fmul.f32(float %tmp2, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict") strictfp
ret float %tmp4
}
declare float @llvm.experimental.constrained.fmul.f32(float, float, metadata, metadata)