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

int FDIVQ(void *rd, void *rs2, void *rs1)
{
	FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R);
	int ret;

	__FP_UNPACK_Q(A, rs1);
	__FP_UNPACK_Q(B, rs2);
	if(B_c == FP_CLS_ZERO &&
	   A_c != FP_CLS_ZERO) {
		ret |= EFLAG_DIVZERO;
		if(__FPU_TRAP_P(EFLAG_DIVZERO))
			return ret;
	}
	FP_DIV_Q(R, A, B);
	return (ret | __FP_PACK_Q(rd, R));
}