From bf0a1e77b53a523b00a1c61e8a1f1bd0d5b8e3a0 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Tue, 8 Dec 2020 18:54:37 +0000 Subject: jc: use MOVWU for unsigned int register load --- utils/ic/reg.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'utils') diff --git a/utils/ic/reg.c b/utils/ic/reg.c index 50df739a..66ab68fe 100644 --- a/utils/ic/reg.c +++ b/utils/ic/reg.c @@ -536,6 +536,8 @@ addmove(Reg *r, int bn, int rn, int f) p1->as = AMOVBU; if(v->etype == TUSHORT) p1->as = AMOVHU; + if(thechar == 'j' && v->etype == TUINT) + p1->as = AMOVWU; } if(debug['R']) print("%P\t.a%P\n", p, p1); -- cgit v1.2.3 From cc8e98237d965c7b4bf99bacf52859ebe1a64b14 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Tue, 8 Dec 2020 18:56:25 +0000 Subject: jc: fix opcode for vlong shifts --- utils/ic/cgen.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'utils') diff --git a/utils/ic/cgen.c b/utils/ic/cgen.c index a8bf5ea1..7afe3290 100644 --- a/utils/ic/cgen.c +++ b/utils/ic/cgen.c @@ -179,11 +179,21 @@ cgen(Node *n, Node *nn) cgen(r, &nod1); gopcode(o, &nod1, Z, &nod); } else { - regalloc(&nod, r, nn); - cgen(r, &nod); - regalloc(&nod1, l, Z); - cgen(l, &nod1); - gopcode(o, &nod, &nod1, &nod); + if(typev[n->type->etype] && + (o == OLSHR || o == OASHL || o == OASHR)){ + /* vlong shifts: result has type of l, not type of r */ + regalloc(&nod1, r, Z); + cgen(r, &nod1); + regalloc(&nod, l, nn); + cgen(l, &nod); + gopcode(o, &nod1, Z, &nod); + }else{ + regalloc(&nod, r, nn); + cgen(r, &nod); + regalloc(&nod1, l, Z); + cgen(l, &nod1); + gopcode(o, &nod, &nod1, &nod); + } } gopcode(OAS, &nod, Z, nn); regfree(&nod); -- cgit v1.2.3 From b745f52dcc336abf1d3c3679ef51c512440143a0 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Tue, 8 Dec 2020 18:58:45 +0000 Subject: il: align data segment between small and large vars --- utils/il/pass.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'utils') diff --git a/utils/il/pass.c b/utils/il/pass.c index 8d3b435b..69aec247 100644 --- a/utils/il/pass.c +++ b/utils/il/pass.c @@ -68,6 +68,8 @@ dodata(void) orig += v; s->type = SDATA1; } + while(orig & 7) + orig++; orig1 = orig; /* -- cgit v1.2.3