fpu_explode.c (95587) | fpu_explode.c (96422) |
---|---|
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_explode.c 8.1 (Berkeley) 6/11/93 43 * $NetBSD: fpu_explode.c,v 1.5 2000/08/03 18:32:08 eeh 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_explode.c 8.1 (Berkeley) 6/11/93 43 * $NetBSD: fpu_explode.c,v 1.5 2000/08/03 18:32:08 eeh Exp $ 44 */ 45 46#include <sys/cdefs.h> |
47__FBSDID("$FreeBSD: head/lib/libc/sparc64/fpu/fpu_explode.c 95587 2002-04-27 21:56:28Z jake $"); | 47__FBSDID("$FreeBSD: head/lib/libc/sparc64/fpu/fpu_explode.c 96422 2002-05-11 21:20:05Z jake $"); |
48 49/* 50 * FPU subroutines: `explode' the machine's `packed binary' format numbers 51 * into our internal format. 52 */ 53 54#include <sys/param.h> 55 --- 187 unchanged lines hidden (view full) --- 243 * operations are performed.) 244 */ 245void 246__fpu_explode(fe, fp, type, reg) 247 struct fpemu *fe; 248 struct fpn *fp; 249 int type, reg; 250{ | 48 49/* 50 * FPU subroutines: `explode' the machine's `packed binary' format numbers 51 * into our internal format. 52 */ 53 54#include <sys/param.h> 55 --- 187 unchanged lines hidden (view full) --- 243 * operations are performed.) 244 */ 245void 246__fpu_explode(fe, fp, type, reg) 247 struct fpemu *fe; 248 struct fpn *fp; 249 int type, reg; 250{ |
251 u_int s; 252 u_int64_t l; | 251 u_int32_t s, *sp; 252 u_int64_t l[2]; |
253 | 253 |
254 l = __fpu_getreg64(reg & ~1); 255 s = __fpu_getreg(reg); 256 fp->fp_sign = s >> 31; | 254 if (type == FTYPE_LNG || type == FTYPE_DBL || type == FTYPE_EXT) { 255 l[0] = __fpu_getreg64(reg & ~1); 256 sp = (u_int32_t *)l; 257 fp->fp_sign = sp[0] >> 31; 258 } else { 259 s = __fpu_getreg(reg); 260 fp->fp_sign = s >> 31; 261 } |
257 fp->fp_sticky = 0; 258 switch (type) { 259 case FTYPE_LNG: | 262 fp->fp_sticky = 0; 263 switch (type) { 264 case FTYPE_LNG: |
260 s = __fpu_xtof(fp, l); | 265 s = __fpu_xtof(fp, l[0]); |
261 break; 262 263 case FTYPE_INT: 264 s = __fpu_itof(fp, s); 265 break; 266 267 case FTYPE_SNG: 268 s = __fpu_stof(fp, s); 269 break; 270 271 case FTYPE_DBL: | 266 break; 267 268 case FTYPE_INT: 269 s = __fpu_itof(fp, s); 270 break; 271 272 case FTYPE_SNG: 273 s = __fpu_stof(fp, s); 274 break; 275 276 case FTYPE_DBL: |
272 s = __fpu_dtof(fp, s, __fpu_getreg(reg + 1)); | 277 s = __fpu_dtof(fp, sp[0], sp[1]); |
273 break; 274 275 case FTYPE_EXT: | 278 break; 279 280 case FTYPE_EXT: |
276 s = __fpu_qtof(fp, s, __fpu_getreg(reg + 1), 277 __fpu_getreg(reg + 2), 278 __fpu_getreg(reg + 3)); | 281 l[1] = __fpu_getreg64((reg & ~1) + 2); 282 s = __fpu_qtof(fp, sp[0], sp[1], sp[2], sp[3]); |
279 break; 280 281 default: 282 __utrap_panic("fpu_explode"); 283 } 284 285 if (s == FPC_QNAN && (fp->fp_mant[0] & FP_QUIETBIT) == 0) { 286 /* --- 20 unchanged lines hidden --- | 283 break; 284 285 default: 286 __utrap_panic("fpu_explode"); 287 } 288 289 if (s == FPC_QNAN && (fp->fp_mant[0] & FP_QUIETBIT) == 0) { 290 /* --- 20 unchanged lines hidden --- |