diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-25 14:02:43 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-25 14:02:43 -0400 |
commit | 62e238a6ef151d56b79e1f076a57463f2e1fb020 (patch) | |
tree | 29c858054c62230eb73330f165cf30ff20e14d86 /src/test/fpcnv.ssa | |
parent | 97b58def96d47d937d86849380d8316ddb16bed8 (diff) | |
download | roux-62e238a6ef151d56b79e1f076a57463f2e1fb020.tar.gz |
great renaming campain!
Diffstat (limited to 'src/test/fpcnv.ssa')
-rw-r--r-- | src/test/fpcnv.ssa | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/fpcnv.ssa b/src/test/fpcnv.ssa new file mode 100644 index 0000000..5fd3be9 --- /dev/null +++ b/src/test/fpcnv.ssa @@ -0,0 +1,27 @@ +# floating point casts and conversions + +function s $fneg(s %f) { +@fneg + %b0 =w cast %f + %b1 =w xor 2147483648, %b0 + %rs =s cast %b1 + ret %rs +} + +function d $ftrunc(d %f) { +@ftrunc + %l0 =l ftosi %f + %rt =d sitof %l0 + ret %rt +} + +# >>> driver +# extern float fneg(float); +# extern double ftrunc(double); +# int main() { +# if (fneg(1.23f) != -1.23f) return 1; +# if (ftrunc(3.1415) != 3.0) return 2; +# if (ftrunc(-1.234) != -1.0) return 3; +# return 0; +# } +# <<< |