diff options
Diffstat (limited to 'arch/sparc/math-emu/fcmpes.c')
-rw-r--r-- | arch/sparc/math-emu/fcmpes.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/sparc/math-emu/fcmpes.c b/arch/sparc/math-emu/fcmpes.c new file mode 100644 index 000000000..e20884cfd --- /dev/null +++ b/arch/sparc/math-emu/fcmpes.c @@ -0,0 +1,18 @@ +#include "soft-fp.h" +#include "single.h" + +int FCMPES(void *rd, void *rs2, void *rs1) +{ + FP_DECL_S(A); FP_DECL_S(B); + long ret; + unsigned long *fsr = rd; + + __FP_UNPACK_S(A, rs1); + __FP_UNPACK_S(B, rs2); + FP_CMP_S(ret, B, A, 1); + if (ret == -1) + ret = 2; + + *fsr = (*fsr & ~0xc00) | (ret << 10); + return 1; +} |