From 3c0bc205fcf8e38cf4fc6658412ee254ac2cf248 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 15 Jan 2017 10:21:02 +0100 Subject: [PATCH] Update the hi/lo syntax to be a bit more standard. --- mach/powerpc/as/mach3.c | 4 ++-- mach/powerpc/as/mach4.c | 12 ++++++------ mach/powerpc/ncg/table | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mach/powerpc/as/mach3.c b/mach/powerpc/as/mach3.c index 62ed20471..a40e2495d 100644 --- a/mach/powerpc/as/mach3.c +++ b/mach/powerpc/as/mach3.c @@ -103,8 +103,8 @@ 0, OP_LA, 0, "li", 0, OP_RS_RA_RA_C, 31<<26 | 444<<1, "mr", 0, OP_POWERPC_FIXUP, 0, ".powerpcfixup", -0, OP_HI, 0, "hi", -0, OP_LO, 0, "lo", +0, OP_HI, 0, "ha16", +0, OP_LO, 0, "lo16", /* Branch processor instructions (page 20) */ diff --git a/mach/powerpc/as/mach4.c b/mach/powerpc/as/mach4.c index d9e4b0371..016877576 100644 --- a/mach/powerpc/as/mach4.c +++ b/mach/powerpc/as/mach4.c @@ -76,12 +76,12 @@ e16 serror("16-bit value out of range"); $$ = (uint16_t) $1; } - | OP_HI expr + | OP_HI ASC_LPAR expr ASC_RPAR { /* If this is a symbol reference, discard the symbol and keep only the * offset part. */ - quad type = $2.typ & S_TYP; - quad val = $2.val; + quad type = $3.typ & S_TYP; + quad val = $3.val; /* If the assembler stored a symbol for relocation later, we need to * abandon it (because we're not going to generate a relocation). */ @@ -90,10 +90,10 @@ e16 $$ = ((quad)val) >> 16; } - | OP_LO expr + | OP_LO ASC_LPAR expr ASC_RPAR { - quad type = $2.typ & S_TYP; - quad val = $2.val; + quad type = $3.typ & S_TYP; + quad val = $3.val; /* If the assembler stored a symbol for relocation later, we need to * abandon it (because we're not going to generate a relocation). */ diff --git a/mach/powerpc/ncg/table b/mach/powerpc/ncg/table index 29353a259..a907e4294 100644 --- a/mach/powerpc/ncg/table +++ b/mach/powerpc/ncg/table @@ -169,14 +169,14 @@ TOKENS /* Used only in instruction descriptions (to generate the correct syntax). */ GPRINDIRECT = { GPR reg; INT off; } 4 off "(" reg ")". - GPRINDIRECT_OFFSET_LO = { GPR reg; ADDR adr; } 4 "lo [" adr "](" reg ")". + GPRINDIRECT_OFFSET_LO = { GPR reg; ADDR adr; } 4 "lo16[" adr "](" reg ")". CONST = { INT val; } 4 val. /* Primitives */ LABEL = { ADDR adr; } 4 adr. - LABEL_OFFSET_HI = { ADDR adr; } 4 "hi " adr. - LABEL_OFFSET_LO = { ADDR adr; } 4 "lo " adr. + LABEL_OFFSET_HI = { ADDR adr; } 4 "ha16[" adr "]". + LABEL_OFFSET_LO = { ADDR adr; } 4 "lo16[" adr "]". LOCAL = { INT off; } 4. /* Allows us to use regvar() to refer to registers */