mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-13 17:37:00 +00:00

With this, FMF(contract) becomes an alternative way to express the request to contract. These are currently only propagated for FMul, FAdd and FSub. The rest will be added as more FMFs are hooked up for this. This is toward fixing PR25721. Differential Revision: https://reviews.llvm.org/D31168 llvm-svn: 299469
30 lines
788 B
C++
30 lines
788 B
C++
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
|
|
|
|
float fp_contract_1(float a, float b, float c) {
|
|
// CHECK-LABEL: fp_contract_1fff(
|
|
// CHECK: fmul contract float
|
|
// CHECK: fadd contract float
|
|
return a * b + c;
|
|
}
|
|
|
|
float fp_contract_2(float a, float b, float c) {
|
|
// CHECK-LABEL: fp_contract_2fff(
|
|
// CHECK: fmul contract float
|
|
// CHECK: fsub contract float
|
|
return a * b - c;
|
|
}
|
|
|
|
void fp_contract_3(float *a, float b, float c) {
|
|
// CHECK-LABEL: fp_contract_3Pfff(
|
|
// CHECK: fmul contract float
|
|
// CHECK: fadd contract float
|
|
a[0] += b * c;
|
|
}
|
|
|
|
void fp_contract_4(float *a, float b, float c) {
|
|
// CHECK-LABEL: fp_contract_4Pfff(
|
|
// CHECK: fmul contract float
|
|
// CHECK: fsub contract float
|
|
a[0] -= b * c;
|
|
}
|