emit "bl .fromf2l"
cost 4;
- out:(dret)reg = FROMSI.D(in:(iret)reg)
+ out:(double)reg = FROMSI.D(in:(int)reg)
with corrupted(volatile)
- emit "bl .fromsi2d"
+ emit "stwu %in, -4(sp)"
+ emit "bl .cif8"
+ emit "lfd %out, 0(sp)"
+ emit "addi sp, sp, 8"
cost 4;
out:(fret)reg = FROMUI.F(in:(iret)reg)
emit "bl .fromui2f"
cost 4;
- out:(dret)reg = FROMUI.D(in:(iret)reg)
+ out:(double)reg = FROMUI.D(in:(int)reg)
with corrupted(volatile)
- emit "bl .fromui2d"
+ emit "stwu %in, -4(sp)"
+ emit "bl .cuf8"
+ emit "lfd %out, 0(sp)"
+ emit "addi sp, sp, 8"
cost 4;
out:(lret)reg = FROMIPAIR.L(in1:(int)reg, in2:(int)reg)
--- /dev/null
+#include "test.h"
+
+/* Constants in globals to defeat constant folding. */
+int one = 1;
+int zero = 0;
+int minusone = -1;
+int big = 0x7fffffff;
+int minusbig = -0x8000000;
+
+/* Bypasses the CRT, so there's no stdio or BSS initialisation. */
+void _m_a_i_n(void)
+{
+ ASSERT((double)zero == 0.0);
+ ASSERT((double)one == 1.0);
+ ASSERT((double)minusone == -1.0);
+ ASSERT((double)big == 2147483647.0);
+ /* ASSERT((double)minusbig == -2147483648.0); FIXME: fails for now */
+
+ finished();
+}
\ No newline at end of file
--- /dev/null
+#include "test.h"
+
+/* Constants in globals to defeat constant folding. */
+unsigned int one_u = 1;
+unsigned int zero_u = 0;
+unsigned int big_u = 0xffffffff;
+
+/* Bypasses the CRT, so there's no stdio or BSS initialisation. */
+void _m_a_i_n(void)
+{
+ ASSERT((double)zero_u == 0.0);
+ ASSERT((double)one_u == 1.0);
+ ASSERT((double)big_u == 4294967295.0);
+
+ finished();
+}
\ No newline at end of file
--- /dev/null
+#include "test.h"
+
+/* Constants in globals to defeat constant folding. */
+double one = 1.0;
+double zero = 0.0;
+
+/* Bypasses the CRT, so there's no stdio or BSS initialisation. */
+void _m_a_i_n(void)
+{
+ ASSERT(zero == zero);
+ ASSERT(one != zero);
+ ASSERT(zero < one);
+ ASSERT(zero <= one);
+ ASSERT(zero <= zero);
+ ASSERT(one > zero);
+ ASSERT(one >= zero);
+ ASSERT(one >= one);
+
+ finished();
+}
\ No newline at end of file