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