cif8 and cuf8 work now. More tests.
This commit is contained in:
parent
cc660b230f
commit
454a7494bb
|
@ -407,9 +407,12 @@ PATTERNS
|
||||||
emit "bl .fromf2l"
|
emit "bl .fromf2l"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
out:(dret)reg = FROMSI.D(in:(iret)reg)
|
out:(double)reg = FROMSI.D(in:(int)reg)
|
||||||
with corrupted(volatile)
|
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;
|
cost 4;
|
||||||
|
|
||||||
out:(fret)reg = FROMUI.F(in:(iret)reg)
|
out:(fret)reg = FROMUI.F(in:(iret)reg)
|
||||||
|
@ -417,9 +420,12 @@ PATTERNS
|
||||||
emit "bl .fromui2f"
|
emit "bl .fromui2f"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
out:(dret)reg = FROMUI.D(in:(iret)reg)
|
out:(double)reg = FROMUI.D(in:(int)reg)
|
||||||
with corrupted(volatile)
|
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;
|
cost 4;
|
||||||
|
|
||||||
out:(lret)reg = FROMIPAIR.L(in1:(int)reg, in2:(int)reg)
|
out:(lret)reg = FROMIPAIR.L(in1:(int)reg, in2:(int)reg)
|
||||||
|
|
20
plat/qemuppc/tests/cif8_e.c
Normal file
20
plat/qemuppc/tests/cif8_e.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#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();
|
||||||
|
}
|
16
plat/qemuppc/tests/cuf8_e.c
Normal file
16
plat/qemuppc/tests/cuf8_e.c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#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();
|
||||||
|
}
|
20
plat/qemuppc/tests/doublecmp_e.c
Normal file
20
plat/qemuppc/tests/doublecmp_e.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#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();
|
||||||
|
}
|
Loading…
Reference in a new issue