/ Copyright (c) 1988 by Sun Microsystems, Inc.
/ @(#)sh_fract-sun386.il 1.7 88/08/13 Copyright 1988 Sun Micro

	.inline	vfradd,8
	movl	(%esp),%eax
	addl	4(%esp),%eax
/	.noopt
	jno	.+9
	incw	fract_overflows
/	.opt
	.end

	.inline	vfrsub,8
	movl	(%esp),%eax
	subl	4(%esp),%eax
/	.noopt
	jno	.+9
	incw	fract_overflows
/	.opt
	.end

	.inline	frmul,8
	pushl	%edx
	movl	4(%esp),%eax
	imull	8(%esp)
	shrdl	$16,%edx,%eax
	popl	%edx
	.end

	.inline	vfrmul,8
	pushl	%edx
	movl	4(%esp),%eax
	imull	8(%esp)
	shrdl	$16,%edx,%eax
	roll	$16,%edx
	cmpw	$0,%dx
/	.noopt
	je	.+16
	cmpw	$65535,%dx
	je	.+9
	incw	fract_overflows
/	.opt
	popl	%edx
	.end

	.inline	frdiv,8
	pushl	%edx
	movl	4(%esp),%eax
	cltd
	shldl	$16,%eax,%edx
	shll	$16,%eax
	idivl	8(%esp)
	popl	%edx
	.end
/
/	You cannot tell from the flags after an idiv instruction if there
/	was an overflow. The 386 produces a fault if the divide overflows.
/
	.inline	vfrdiv,8
	pushl	%edx
	movl	4(%esp),%eax
	cltd
	shldl	$16,%eax,%edx
	shll	$16,%eax
	idivl	8(%esp)
	popl	%edx
	.end
