handle big constants moves to slots
[qbe.git] / test / fpcnv.ssa
blobd9851d8b024294099528569989bd14283b056712
1 # floating point casts and conversions
3 export
4 function s $fneg(s %f) {
5 @fneg
6         %b0 =w cast %f
7         %b1 =w xor 2147483648, %b0
8         %rs =s cast %b1
9         ret %rs
12 export
13 function d $ftrunc(d %f) {
14 @ftrunc
15         %l0 =w dtosi %f
16         %rt =d swtof %l0
17         ret %rt
20 # >>> driver
21 # extern float fneg(float);
22 # extern double ftrunc(double);
23 # int main() {
24 #       if (fneg(1.23f) != -1.23f)  return 1;
25 #       if (ftrunc(3.1415) != 3.0)  return 2;
26 #       if (ftrunc(-1.234) != -1.0) return 3;
27 #       return 0;
28 # }
29 # <<<