ack/mach
George Koehler 893df4b79b Experiment with 8-byte integers in ncg i386.
This provides adi, sbi, mli, dvi, rmi, ngi, dvu, rmu 8, but is missing
shifts and rotates.  It is also missing conversions between 8-byte
integers and other sizes of integers or floats.  The code might not be
all correct, but works at least some of the time.

I adapted this from how ncg i86 does 4-byte integers, but I use a
different algorithm when dividing by a large value: i86 avoids the div
instruction and uses a shift-and-subtract loop; but I use the div
instruction to estimate a quotient, which is more like how big integer
libraries do division.  My .dvi8 and .dvu8 also set ecx:ebx to the
remainder; this might be a bad idea, because it requires .dvi8 and
.dvu8 to always calculate the remainder, even when the caller only
wants the quotient.

To play with 8-byte integers, I wrote EM procedures like

     mes 2, 4, 4
     exp $ngi
     pro $ngi,0
     ldl 4
     ngi 8
     lol 0
     sti 8
     lol 0
     ret 4
     end
     exp $adi
     pro $adi,0
     ldl 4
     ldl 12
     adi 8
     lol 0
     sti 8
     lol 0
     ret 4
     end

and called them from C like

    typedef struct { int l; int h; } q;
    q ngi(q);
    q adi(q, q);
2019-08-20 13:38:18 -04:00
..
6500 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
6800 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
6805 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
6809 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
arm Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
em22 Add the core of a simple em22 platform. Unfortunately it doesn't work; the old 2018-06-10 20:25:48 +09:00
em24 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
em44 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
i80 Teach some ncg machines to use .data8 2019-08-13 15:37:05 -04:00
i86 Teach some ncg machines to use .data8 2019-08-13 15:37:05 -04:00
i386 Experiment with 8-byte integers in ncg i386. 2019-08-20 13:38:18 -04:00
m68k2 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
m68k4 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
m68020 Teach some ncg machines to use .data8 2019-08-13 15:37:05 -04:00
mantra Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
minix Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
minixST Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
mips Fix issue with logical operations and small signed constants which turned out 2019-02-13 20:56:10 +01:00
moon3/ncg Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
ns Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
pdp Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
pmds Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
pmds4 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
powerpc Teach some ncg machines to use .data8 2019-08-13 15:37:05 -04:00
proto Add .data8 for 8-byte literal integers to the assembler. 2019-08-13 11:47:44 -04:00
s2650 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
sparc Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
sparc_solaris Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
sun2 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
sun3 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
vax4 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
vc4 Teach some ncg machines to use .data8 2019-08-13 15:37:05 -04:00
xenix3 Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
z80 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00
z8000 Fix several compiler warnings by adding braces 2019-05-14 23:21:19 +08:00