Deleted Added
full compact
fpu_add.c (92986) fpu_add.c (95587)
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This software was developed by the Computer Systems Engineering group
6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7 * contributed to Berkeley.
8 *

--- 30 unchanged lines hidden (view full) ---

39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 * @(#)fpu_add.c 8.1 (Berkeley) 6/11/93
43 * $NetBSD: fpu_add.c,v 1.3 1996/03/14 19:41:52 christos Exp $
44 */
45
46#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This software was developed by the Computer Systems Engineering group
6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7 * contributed to Berkeley.
8 *

--- 30 unchanged lines hidden (view full) ---

39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 * @(#)fpu_add.c 8.1 (Berkeley) 6/11/93
43 * $NetBSD: fpu_add.c,v 1.3 1996/03/14 19:41:52 christos Exp $
44 */
45
46#include <sys/cdefs.h>
47__FBSDID("$FreeBSD: head/lib/libc/sparc64/fpu/fpu_add.c 92986 2002-03-22 21:53:29Z obrien $");
47__FBSDID("$FreeBSD: head/lib/libc/sparc64/fpu/fpu_add.c 95587 2002-04-27 21:56:28Z jake $");
48
49/*
50 * Perform an FPU add (return x + y).
51 *
52 * To subtract, negate y and call add.
53 */
54
55#include <sys/param.h>
56
57#include <machine/frame.h>
58#include <machine/fp.h>
59#include <machine/fsr.h>
60#include <machine/instr.h>
61
62#include "fpu_arith.h"
63#include "fpu_emu.h"
64#include "fpu_extern.h"
48
49/*
50 * Perform an FPU add (return x + y).
51 *
52 * To subtract, negate y and call add.
53 */
54
55#include <sys/param.h>
56
57#include <machine/frame.h>
58#include <machine/fp.h>
59#include <machine/fsr.h>
60#include <machine/instr.h>
61
62#include "fpu_arith.h"
63#include "fpu_emu.h"
64#include "fpu_extern.h"
65#include "__sparc_utrap_private.h"
65
66struct fpn *
67__fpu_add(fe)
68 struct fpemu *fe;
69{
70 struct fpn *x = &fe->fe_f1, *y = &fe->fe_f2, *r;
71 u_int r0, r1, r2, r3;
72 int rd;

--- 120 unchanged lines hidden (view full) ---

193 /*
194 * Oops, case iii. This can only occur when the
195 * exponents were equal, in which case neither
196 * x nor y have sticky bits set. Flip the sign
197 * (to y's sign) and negate the result to get y - x.
198 */
199#ifdef DIAGNOSTIC
200 if (x->fp_exp != y->fp_exp || r->fp_sticky)
66
67struct fpn *
68__fpu_add(fe)
69 struct fpemu *fe;
70{
71 struct fpn *x = &fe->fe_f1, *y = &fe->fe_f2, *r;
72 u_int r0, r1, r2, r3;
73 int rd;

--- 120 unchanged lines hidden (view full) ---

194 /*
195 * Oops, case iii. This can only occur when the
196 * exponents were equal, in which case neither
197 * x nor y have sticky bits set. Flip the sign
198 * (to y's sign) and negate the result to get y - x.
199 */
200#ifdef DIAGNOSTIC
201 if (x->fp_exp != y->fp_exp || r->fp_sticky)
201 __fpu_panic("fpu_add");
202 __utrap_panic("fpu_add");
202#endif
203 r->fp_sign = y->fp_sign;
204 FPU_SUBS(r3, 0, r3);
205 FPU_SUBCS(r2, 0, r2);
206 FPU_SUBCS(r1, 0, r1);
207 FPU_SUBC(r0, 0, r0);
208 }
209 r->fp_mant[3] = r3;
210 r->fp_mant[2] = r2;
211 r->fp_mant[1] = r1;
212 r->fp_mant[0] = r0;
213 if (r0 < FP_1)
214 __fpu_norm(r);
215 }
216 return (r);
217}
203#endif
204 r->fp_sign = y->fp_sign;
205 FPU_SUBS(r3, 0, r3);
206 FPU_SUBCS(r2, 0, r2);
207 FPU_SUBCS(r1, 0, r1);
208 FPU_SUBC(r0, 0, r0);
209 }
210 r->fp_mant[3] = r3;
211 r->fp_mant[2] = r2;
212 r->fp_mant[1] = r1;
213 r->fp_mant[0] = r0;
214 if (r0 < FP_1)
215 __fpu_norm(r);
216 }
217 return (r);
218}