summaryrefslogtreecommitdiffstats
path: root/arch/sparc/math-emu/fcmpq.c
blob: 549f02cae3b83aa20fa35f2e2b4f0b7a26328749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}