summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-09-03 17:01:56 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-09-03 17:01:56 +0200
commit607f3bc55c2425c7e7d022961517793eb20f3b74 (patch)
treec7d44862ebc41878b37bdc8a48824d1cba79d9d1 /sys/src
parent2e120a29db72b3fbe104d6168f2837f64c738e2e (diff)
5l: format assembly constant right shift encoding 0 as >>32
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/cmd/5l/list.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/src/cmd/5l/list.c b/sys/src/cmd/5l/list.c
index 2422bcc0f..228cc1c56 100644
--- a/sys/src/cmd/5l/list.c
+++ b/sys/src/cmd/5l/list.c
@@ -143,8 +143,12 @@ Dconv(Fmt *fp)
op = "<<>>->@>" + (((v>>5) & 3) << 1);
if(v & (1<<4))
snprint(str, sizeof str, "R%ld%c%cR%ld", v&15, op[0], op[1], (v>>8)&15);
- else
- snprint(str, sizeof str, "R%ld%c%c%ld", v&15, op[0], op[1], (v>>7)&31);
+ else {
+ long sh = (v>>7)&31;
+ if(sh == 0 && (v & (3<<5)) != 0)
+ sh = 32;
+ snprint(str, sizeof str, "R%ld%c%c%ld", v&15, op[0], op[1], sh);
+ }
if(a->reg != NREG)
snprint(str+strlen(str), sizeof(str)-strlen(str), "(R%d)", a->reg);
break;