From: William F. Jolitz Date: Tue, 22 Jan 1991 06:57:20 +0000 (-0800) Subject: 386BSD 0.1 development X-Git-Tag: 386BSD-0.1~2158 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/96fae398f5295cd2bab95b1d1de8582cb5c29208?ds=inline 386BSD 0.1 development Work on file usr/src/usr.bin/gcc/gnulib/longlong/negdi2.c Co-Authored-By: Lynne Greer Jolitz Synthesized-from: 386BSD-0.1 --- diff --git a/usr/src/usr.bin/gcc/gnulib/longlong/negdi2.c b/usr/src/usr.bin/gcc/gnulib/longlong/negdi2.c new file mode 100644 index 0000000000..068392a731 --- /dev/null +++ b/usr/src/usr.bin/gcc/gnulib/longlong/negdi2.c @@ -0,0 +1,43 @@ +#include "longlong.h" + +static int bneg (); + +long long +__negdi2 (u) + long long u; +{ + unsigned long a[2], b[2]; + long_long w; + long_long uu; + + uu.ll = u; + + a[HIGH] = uu.s.high; + a[LOW] = uu.s.low; + + bneg (a, b, sizeof b); + + w.s.high = b[HIGH]; + w.s.low = b[LOW]; + return w.ll; +} + +static int +bneg (a, b, n) + unsigned short *a, *b; + size_t n; +{ + signed long acc; + int i; + + n /= sizeof (short); + + acc = 0; + for (i = little_end (n); is_not_msd (i, n); i = next_msd (i)) + { + acc -= a[i]; + b[i] = acc & low16; + acc = acc >> 16; + } + return acc; +}