5 * Core multiplication routine
8 * Copyright (C) 1992,1993,1994
9 * W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
10 * Australia. E-mail billm@vaxc.cc.monash.edu.au
11 * All rights reserved.
13 * This copyright notice covers the redistribution and use of the
14 * FPU emulator developed by W. Metzenthen. It covers only its use
15 * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
16 * use is not permitted under this copyright.
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must include information specifying
24 * that source code for the emulator is freely available and include
26 * a) an offer to provide the source code for a nominal distribution
28 * b) list at least two alternative methods whereby the source
29 * can be obtained, e.g. a publically accessible bulletin board
30 * and an anonymous ftp site from which the software can be
32 * 3. All advertising materials specifically mentioning features or use of
33 * this emulator must acknowledge that it was developed by W. Metzenthen.
34 * 4. The name of W. Metzenthen may not be used to endorse or promote
35 * products derived from this software without specific prior written
38 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
39 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
41 * W. METZENTHEN BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
42 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
43 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
44 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
45 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
46 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 * The purpose of this copyright, based upon the Berkeley copyright, is to
51 * ensure that the covered software remains freely available to everyone.
53 * The software (with necessary differences) is also available, but under
54 * the terms of the GNU copyleft, for the Linux operating system and for
55 * the djgpp ms-dos extender.
57 * W. Metzenthen June 1994.
60 * $FreeBSD: src/sys/gnu/i386/fpemul/reg_u_mul.s,v 1.9 1999/08/28 00:42:58 peter Exp $
61 * $DragonFly: src/sys/i386/gnu/fpemul/Attic/reg_u_mul.s,v 1.2 2003/06/17 04:28:34 dillon Exp $
65 /*---------------------------------------------------------------------------+
66 | Basic multiplication routine. |
67 | Does not check the resulting exponent for overflow/underflow |
69 | reg_u_mul(FPU_REG *a, FPU_REG *b, FPU_REG *c, unsigned int cw); |
71 | Internal working is at approx 128 bits. |
72 | Result is rounded to nearest 53 or 64 bits, using "nearest or even". |
73 +---------------------------------------------------------------------------*/
75 #include <gnu/i386/fpemul/fpu_asm.h>
98 testl $0x80000000,SIGH(%esi)
100 testl $0x80000000,SIGH(%edi)
104 #ifdef DENORM_OPERAND
109 call _denormal_operand
118 call _denormal_operand
123 #endif DENORM_OPERAND
137 /* adcl $0,%ecx *//* overflow here is not possible */
150 movl EXP(%esi),%eax /* Compute the exponent */
153 /* Have now finished with the sources */
154 movl PARAM3,%edi /* Point to the destination */
157 /* Now make sure that the result is normalized */
158 testl $0x80000000,%ecx
159 jnz LResult_Normalised
161 /* Normalize by shifting left one bit */
183 pushl EX_INTERNAL|0x205