diff options
Diffstat (limited to 'src/cmd/6g/galign.c')
-rw-r--r-- | src/cmd/6g/galign.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/cmd/6g/galign.c b/src/cmd/6g/galign.c index 526c04c06..1d32c5a61 100644 --- a/src/cmd/6g/galign.c +++ b/src/cmd/6g/galign.c @@ -8,9 +8,22 @@ int thechar = '6'; char* thestring = "amd64"; +LinkArch* thelinkarch = &linkamd64; + +void +linkarchinit(void) +{ + if(strcmp(getgoarch(), "amd64p32") == 0) + thelinkarch = &linkamd64p32; +} vlong MAXWIDTH = 1LL<<50; +int addptr = AADDQ; +int movptr = AMOVQ; +int leaptr = ALEAQ; +int cmpptr = ACMPQ; + /* * go declares several platform-specific type aliases: * int, uint, float, and uintptr @@ -28,6 +41,19 @@ betypeinit(void) { widthptr = 8; widthint = 8; + widthreg = 8; + if(strcmp(getgoarch(), "amd64p32") == 0) { + widthptr = 4; + widthint = 4; + addptr = AADDL; + movptr = AMOVL; + leaptr = ALEAL; + cmpptr = ACMPL; + typedefs[0].sameas = TINT32; + typedefs[1].sameas = TUINT32; + typedefs[2].sameas = TUINT32; + + } zprog.link = P; zprog.as = AGOK; @@ -36,5 +62,5 @@ betypeinit(void) zprog.from.scale = 0; zprog.to = zprog.from; - listinit(); + listinit6(); } |