Uninitialized vector entry?
[minix3.git] / lib / float / adder.c
bloba0af3ce75844b01badee21b652693205a4d5f411
1 /*
2 (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 See the copyright notice in the ACK home directory, in the file "Copyright".
4 */
6 /* $Header$ */
8 /*
9 * these are the routines the routines to do 32 and 64-bit addition
12 # ifdef EXT_DEBUG
13 # include <stdio.h>
14 # endif
16 # include "FP_types.h"
17 # define UNKNOWN -1
18 # define TRUE 1
19 # define FALSE 0
20 # define MAXBIT 0x80000000L
23 * add 64 bits
25 int
26 b64_add(e1,e2)
28 * pointers to 64 bit 'registers'
30 register B64 *e1,*e2;
32 register int overflow;
33 int carry;
35 /* add higher pair of 32 bits */
36 overflow = ((unsigned long) 0xFFFFFFFF - e1->h_32 < e2->h_32);
37 e1->h_32 += e2->h_32;
39 /* add lower pair of 32 bits */
40 carry = ((unsigned long) 0xFFFFFFFF - e1->l_32 < e2->l_32);
41 e1->l_32 += e2->l_32;
42 # ifdef EXT_DEBUG
43 printf("\t\t\t\t\tb64_add: overflow (%d); internal carry(%d)\n",
44 overflow,carry);
45 fflush(stdout);
46 # endif
47 if ((carry) && (++e1->h_32 == 0))
48 return(TRUE); /* had a 64 bit overflow */
49 return(overflow); /* return status from higher add */