2
/* Copyright (C) 1994 W. Schelter
4
This file is part of GNU Common Lisp, herein referred to as GCL
6
GCL is free software; you can redistribute it and/or modify it under
7
the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
GCL is distributed in the hope that it will be useful, but WITHOUT
12
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16
You should have received a copy of the GNU library general public
17
license along with GCL; see the file COPYING. If not, write to the
18
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
30
#define HIBIT 0x80000000
31
#define HIMASK 0xffff0000
33
#define HIWORD(a) (a >> 16)
34
/* si le compilateur est bugge, il faut mettre (a >> 16) & LOMASK) */
35
#define LOWORD(a) (a & LOMASK)
36
#define GLUE(hi, lo) ((hi << 16) + lo)
37
#define SPLIT(a, b, c) b = HIWORD(a); c = LOWORD(a)
39
our_ulong v1, v2, u3, u4, q1, q2, aux, aux1, aux2,hiremainder=*hi;
42
for(k = 0; !(y & HIBIT); k++)
45
if (x & HIBIT) hiremainder++;
53
q1 = hiremainder / v1; if (q1 & HIMASK) q1 = LOMASK;
54
hiremainder -= q1 * v1;
57
SPLIT(aux, aux1, aux2);
58
if (aux2 > u3) aux1++;
59
if (aux1 > hiremainder) {q1--; hiremainder += v1; aux -= v2; goto again;}
62
hiremainder <<= 16; hiremainder += u3 & LOMASK;
64
q2 = hiremainder / v1; if (q2 & HIMASK) q2 = LOMASK;
65
hiremainder -= q2 * v1;
68
SPLIT(aux, aux1, aux2);
69
if (aux2 > u4) aux1++;
70
if (aux1 > hiremainder) {q2--; hiremainder += v1; aux -= v2; goto again2;}
73
hiremainder <<= 16; hiremainder += u4 & LOMASK;