Teach some ncg machines to use .data8

This turns EM `con 5000000000I8` into assembly `.data8 5000000000` for
machines i386, i80, i86, m68020, powerpc, vc4.  These are the only ncg
machines in our build.

i80 and i86 get con_mult(sz) for sz == 4 and sz == 8.  The other
machines only get sz == 8, because they have 4-byte words, and ncg
only calls con_mult(sz) when sz is greater than the word size.  The
tab "\t" after .data4 or .data8 is like the tabs in the con_*() macros
of mach/*/ncg/mach.h.

i86 now uses .data4, like i80.  Also, i86 and i386 now use the numeric
string without converting it to an integer and back to a string.
This commit is contained in:
George Koehler 2019-08-13 15:37:05 -04:00
parent 054b9c87e1
commit 1faff418ec
6 changed files with 21 additions and 26 deletions

View file

@ -34,13 +34,11 @@ con_part(sz,w) register sz; word w; {
}
void
con_mult(sz) word sz; {
long l;
con_mult(word sz) {
if (sz != 4)
if (sz != 8)
fatal("bad icon/ucon size");
l = atol(str);
fprintf(codefile,"\t.data4 %ld\n", l);
fprintf(codefile,".data8\t%s\n", str);
}
#define CODE_GENERATOR

View file

@ -32,12 +32,12 @@ void con_part(int sz, word w)
part_size += sz;
}
void con_mult(sz) word sz;
{
void
con_mult(word sz) {
if (argval != 4)
if (sz != 4 && sz != 8)
fatal("bad icon/ucon size");
fprintf(codefile, ".data4\t%ld\n", atol(str));
fprintf(codefile,".data%d\t%s\n", (int)sz, str);
}
#define CODE_GENERATOR

View file

@ -33,14 +33,11 @@ con_part(sz,w) register sz; word w; {
}
void
con_mult(sz) word sz; {
long l;
con_mult(word sz) {
if (sz != 4)
if (sz != 4 && sz != 8)
fatal("bad icon/ucon size");
l = atol(str);
fprintf(codefile,"\t.data2 %d,%d\n",
(int)l&0xFFFF,(int)(l>>16)&0xFFFF);
fprintf(codefile,".data%d\t%s\n", (int)sz, str);
}
#define CODE_GENERATOR

View file

@ -45,11 +45,11 @@ con_part(sz,w) register sz; word w; {
}
void
con_mult(sz) word sz; {
con_mult(word sz) {
if (sz != 4)
if (sz != 8)
fatal("bad icon/ucon size");
fprintf(codefile,".data4 %s\n",str);
fprintf(codefile,".data8\t%s\n", str);
}
#define IEEEFLOAT

View file

@ -41,12 +41,11 @@ con_part(int sz, word w)
}
void
con_mult(word sz)
{
con_mult(word sz) {
if (argval != 4)
if (sz != 8)
fatal("bad icon/ucon size");
fprintf(codefile,".data4 %s\n", str);
fprintf(codefile,".data8\t%s\n", str);
}
#define CODE_GENERATOR

View file

@ -29,11 +29,12 @@ void con_part(int sz, word w)
part_size += sz;
}
void con_mult(word sz)
{
if (argval != 4)
void
con_mult(word sz) {
if (sz != 8)
fatal("bad icon/ucon size");
fprintf(codefile,".data4 %s\n", str);
fprintf(codefile,".data8\t%s\n", str);
}
#define CODE_GENERATOR