daeeb5aca3
It seems that someone wanted to build flt_arith with a compiler that had long but not unsigned long. This required extra code to accomplish unsigned right shift, unsigned division, and unsigned comparison using the signed operations. Now that we use uint32_t, we can simply use the unsigned operations and remove the ucmp() function. We have similar code in mach/proto/fp/ and in lang/cem/libcc.ansi/stdlib/ext_comp.c where we use the unsigned operations. Some long variables become uint32_t, and some masks with 0xFFFFFFFF disappear because uint32_t has only 32 bits. Update flt_arith.3 to show that mantissa uses uint32_t. Provide a target to install modules/src/flt_arith/test.c as flt_test so I can run the tests.
27 lines
704 B
C
27 lines
704 B
C
/*
|
|
* (c) copyright 1989 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
*/
|
|
/* $Id$ */
|
|
|
|
#include "flt_arith.h"
|
|
|
|
/* some short-hands ... */
|
|
#define m1 flt_mantissa.flt_h_32
|
|
#define m2 flt_mantissa.flt_l_32
|
|
|
|
/* some constants */
|
|
#define EXT_MAX 16384 /* max exponent */
|
|
#define EXT_MIN (-16384) /* min exponent */
|
|
|
|
/* hiding of names: */
|
|
#define flt_nrm _flt_nrm
|
|
#define flt_chk _flt_chk
|
|
#define flt_b64_add _flt_64add
|
|
#define flt_split _flt_split
|
|
|
|
void flt_nrm(flt_arith *);
|
|
void flt_chk(flt_arith *);
|
|
int flt_b64_add(struct flt_mantissa *, struct flt_mantissa *);
|
|
void flt_split(flt_arith *, unsigned short *);
|