brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · c43d2a6 Raw
42 lines · plain
1; Test that the compiled does not fuse fmul and fadd into fmadd when no -fp-contract=fast2; option is set (the same applies for fmul, fsub and fmsub).3 4; RUN: llc -mtriple=mipsel -mattr=+msa,+fp64,+mips32r2 < %s \5; RUN:   | FileCheck %s --check-prefixes=CHECK-CONTRACT-OFF6; RUN: llc -mtriple=mipsel -mattr=+msa,+fp64,+mips32r2 -fp-contract=off < %s \7; RUN:   | FileCheck %s --check-prefixes=CHECK-CONTRACT-OFF8; RUN: llc -mtriple=mips -mattr=+msa,+fp64,+mips32r2 -fp-contract=fast < %s \9; RUN:   | FileCheck %s --check-prefixes=CHECK-CONTRACT-FAST10 11declare <4 x float> @llvm.mips.fmul.w(<4 x float>, <4 x float>)12declare <4 x float> @llvm.mips.fadd.w(<4 x float>, <4 x float>)13declare <4 x float> @llvm.mips.fsub.w(<4 x float>, <4 x float>)14 15define void @foo(ptr %agg.result, ptr %acc, ptr %a, ptr %b) {16entry:17  %0 = load <4 x float>, ptr %a, align 1618  %1 = load <4 x float>, ptr %b, align 1619  %2 = call <4 x float> @llvm.mips.fmul.w(<4 x float> %0, <4 x float> %1)20  %3 = load <4 x float>, ptr %acc, align 1621  %4 = call <4 x float> @llvm.mips.fadd.w(<4 x float> %3, <4 x float> %2)22  store <4 x float> %4, ptr %agg.result, align 1623  ret void24  ; CHECK-CONTRACT-OFF: fmul.w25  ; CHECK-CONTRACT-OFF: fadd.w26  ; CHECK-CONTRACT-FAST: fmadd.w27}28 29define void @boo(ptr %agg.result, ptr %acc, ptr %a, ptr %b) {30entry:31  %0 = load <4 x float>, ptr %a, align 1632  %1 = load <4 x float>, ptr %b, align 1633  %2 = call <4 x float> @llvm.mips.fmul.w(<4 x float> %0, <4 x float> %1)34  %3 = load <4 x float>, ptr %acc, align 1635  %4 = call <4 x float> @llvm.mips.fsub.w(<4 x float> %3, <4 x float> %2)36  store <4 x float> %4, ptr %agg.result, align 1637  ret void38  ; CHECK-CONTRACT-OFF: fmul.w39  ; CHECK-CONTRACT-OFF: fsub.w40  ; CHECK-CONTRACT-FAST: fmsub.w41}42