summaryrefslogtreecommitdiffstats
path: root/arch/sparc/math-emu/fcmped.c
blob: a8c18804256803bb24a400208cda9332d8ad1ef4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "soft-fp.h"
#include "double.h"

int FCMPED(void *rd, void *rs2, void *rs1)
{
	FP_DECL_D(A); FP_DECL_D(B);
	long ret;
	unsigned long *fsr = rd;
	
	__FP_UNPACK_D(A, rs1);
	__FP_UNPACK_D(B, rs2);
	FP_CMP_D(ret, B, A, 2);
	if (ret == -1)
		ret = 2;

	*fsr = (*fsr & ~0xc00) | (ret << 10); 
	return 1;
}