xref: /llvm-project/llvm/test/CodeGen/AArch64/arm64-fp-contract-zero.ll (revision d5f1131c812df57560c7563475cb0d674a101636)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=arm64 -fp-contract=fast -o - %s | FileCheck %s
3
4
5; Make sure we don't try to fold an fneg into +0.0, creating an illegal constant
6; -0.0. It's also good, though not essential, that we don't resort to a litpool.
7define double @test_fms_fold(double %a, double %b) {
8; CHECK-LABEL: test_fms_fold:
9; CHECK:       // %bb.0:
10; CHECK-NEXT:    movi d2, #0000000000000000
11; CHECK-NEXT:    fmul d1, d1, d2
12; CHECK-NEXT:    fnmsub d0, d0, d2, d1
13; CHECK-NEXT:    ret
14  %mul = fmul double %a, 0.000000e+00
15  %mul1 = fmul double %b, 0.000000e+00
16  %sub = fsub double %mul, %mul1
17  ret double %sub
18}
19