Last active
May 28, 2017 22:55
-
-
Save jbush001/9266b04e40963f5647a7759d4cc4e313 to your computer and use it in GitHub Desktop.
Generating floating point test cases with Berkeley testfloat
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
git clone https://github.com/ucb-bar/berkeley-testfloat-3.git | |
git clone https://github.com/ucb-bar/berkeley-softfloat-3.git | |
cd berkeley-softfloat-3/build/Linux-386-GCC/ | |
make | |
cd ../../../berkeley-testfloat-3/build/Linux-386-GCC/ | |
make | |
./testfloat_gen -precision32 f32 2 f32_add | awk '{ print "{ FADD, 0x" $1 ", 0x" $2 ", 0x" $3 " }," }' > test_cases.inc | |
./testfloat_gen -precision32 f32 2 f32_sub | awk '{ print "{ FSUB, 0x" $1 ", 0x" $2 ", 0x" $3 " }," }' >> test_cases.inc | |
./testfloat_gen -precision32 f32 2 f32_mul | awk '{ print "{ FMUL, 0x" $1 ", 0x" $2 ", 0x" $3 " }," }' >> test_cases.inc | |
./testfloat_gen -precision32 f32 f32_to_i32 | awk '{ print "{ ITOF, 0x" $1 ", 0x" $2 ", 0x" $3 " }," }' >> test_cases.inc | |
./testfloat_gen -precision32 i32 i32_to_f32 | awk '{ print "{ FTOI, 0x" $1 ", 0x" $2 ", 0x" $3 " }," }' >> test_cases.inc | |
./testfloat_gen -precision32 f32 f32_le | awk '{ print "{ FCMPLT, 0x" $1 ", 0x" $2 ", 0x" $3 " }," }' >> test_cases.inc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment