-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add overrides for
fma
, fmaf
, llvm.fmuladd.*
, and llvm.fma.*
Fixes #1154.
- Loading branch information
1 parent
bb50c0d
commit db0fa18
Showing
6 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// A regression test for https://github.com/GaloisInc/crucible/issues/1154. | ||
#include <crucible.h> | ||
#include <math.h> | ||
|
||
// LLVM is liable to optimize these functions in a way that uses the | ||
// llvm.fmuladd.* or llvm.fma.* intrinsics. | ||
float fmuladdf(float a, float b, float c) { | ||
return a * b + c; | ||
} | ||
|
||
double fmuladd(double a, double b, double c) { | ||
return a * b + c; | ||
} | ||
|
||
int main(void) { | ||
float f1 = fmuladdf(1.0f, 2.0f, 3.0f); | ||
check(f1 == f1); | ||
float f2 = fmaf(1.0f, 2.0f, 3.0f); | ||
check(f2 == f2); | ||
|
||
double d1 = fmuladd(1.0, 2.0, 3.0); | ||
check(d1 == d1); | ||
double d2 = fma(1.0, 2.0, 3.0); | ||
check(d2 == d2); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
opt-level: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[Crux] Overall status: Valid. |