xref: /csrg-svn/sys/tahoe/align/Aemul.c (revision 45760)
1*45760Sbostic /*-
2*45760Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*45760Sbostic  * All rights reserved.
4*45760Sbostic  *
5*45760Sbostic  * This code is derived from software contributed to Berkeley by
6*45760Sbostic  * Computer Consoles Inc.
7*45760Sbostic  *
8*45760Sbostic  * %sccs.include.redist.c%
9*45760Sbostic  *
10*45760Sbostic  *	@(#)Aemul.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229607Ssam 
1345699Sbostic #include "align.h"
emul(infop)1429607Ssam emul(infop)	process_info *infop;
1529607Ssam /*
1629607Ssam /*	Extended precision multiplication.
1729607Ssam /*
1829607Ssam /***************************************/
1929607Ssam {
2029607Ssam 	register long Register_12;	/* multiplicand */
2129607Ssam 	register long Register_11;	/* product least */
2229607Ssam 	register long Register_10;	/* product most */
2329607Ssam 	register long Register_9;	/* addend */
2429607Ssam 	register long Register_8;	/* multiplier */
2529607Ssam 	quadword result;
2629607Ssam 
2729607Ssam 	Register_8 = operand(infop, 0)->data;
2829607Ssam 	Register_12 = operand(infop, 1)->data;
2929607Ssam 	Register_9 = operand(infop, 2)->data;
3029607Ssam 	Register_10=psl;
3129607Ssam 	Set_psl(r10);	/* restore the user psl */
3229607Ssam 	asm ("	emul	r8,r12,r9,r10");
3329607Ssam 	asm ("	movpsl	r8");
3429607Ssam 	New_cc (Register_8);
3529607Ssam 	result.high = Register_10;
3629607Ssam 	result.low  = Register_11;
3729607Ssam 	write_quadword (infop, result, operand(infop, 3));
3829607Ssam }
39