|
|
1.1 root 1: /*
2: * exarith(mul1,mul2,add,hi,lo)
3: *
4: * (hi,lo) gets 64 bit product + sum of mul1*mul2+add;
5: * routine returns non-zero if product is bigger than 30 bits
6: *
7: * Copyright (c) 1982, Regents, University of California
8: *
9: * stolen from 68k by P. S. Housel 04/29/86, with minor mods
10: * (replaced call to emul with asm("emul..."))
11: */
12:
13: struct vl
14: {long high;
15: long low;
16: };
17:
18: long exarith(mul1,mul2,add,hi,lo)
19: long *hi, *lo;
20: register long add;
21: {
22: register long rlo;
23: struct vl work;
24:
25: asm(" emul 4(fp),8(fp),r12,-60(fp)");
26:
27: add = work.high;
28: add <<= 2;
29: if((rlo = work.low) < 0) add += 2;
30: if(rlo & 0x40000000) add += 1;
31: *lo = rlo &0x3fffffff;
32: (*hi = add);
33: if((add==0) || (add!=-1)) return(add);
34: *lo = rlo;
35: return(0);
36: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.