X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=sys%2Fsrc%2Flibmach%2F5db.c;h=1bd661423b60942e44eb927638fb452b7d377a21;hb=76ed42e31ff3297f1ca9b144ccc9466b0074f92b;hp=37a99ebdd21d0e1d8853f1b0c8c0641f9ad8dc00;hpb=f5363206986da1454af74af354d100c3f12d4e1e;p=plan9front.git diff --git a/sys/src/libmach/5db.c b/sys/src/libmach/5db.c index 37a99ebdd..1bd661423 100644 --- a/sys/src/libmach/5db.c +++ b/sys/src/libmach/5db.c @@ -185,7 +185,7 @@ armclass(long w) if(w & (1<<4)) op += 32; else - if((w & (31<<7)) || (w & (1<<5))) + if(w & (31<<7 | 3<<5)) op += 16; break; case 1: /* data processing i,r,r */ @@ -499,7 +499,7 @@ static void armhwby(Opcode *o, Instr *i) { i->store = ((i->w >> 23) & 0x2) | ((i->w >>21) & 0x1); - i->imm = (i->w & 0xf) | ((i->w >> 8) & 0xf); + i->imm = (i->w & 0xf) | ((i->w >> 4) & 0xf0); if (!(i->w & (1 << 23))) i->imm = - i->imm; i->rn = (i->w >> 16) & 0xf; @@ -680,11 +680,11 @@ armshiftval(Map *map, Rgetter rget, Instr *i) } return ROR(v, s); case 7: /* RORREG */ - sprint(buf, "R%ld", (s>>1)&0xF); - s = rget(map, buf); - if(s == 0 || (s & 0xF) == 0) + sprint(buf, "R%ld", s >> 1); + s = rget(map, buf) & 0x1F; + if(s == 0) return v; - return ROR(v, s & 0xF); + return ROR(v, s); } } } @@ -930,9 +930,9 @@ static Opcode opcodes[] = "SWPB", armdpi, 0, "R%s,(R%n),R%d", /* 48+16+4 */ - "MOV%u%C%p", armhwby, 0, "R%d,(R%n%UR%M)", + "MOV%u%C%p", armhwby, 0, "R%d,(R%n%UR%s)", "MOV%u%C%p", armhwby, 0, "R%d,%I", - "MOV%u%C%p", armhwby, armfmov, "(R%n%UR%M),R%d", + "MOV%u%C%p", armhwby, armfmov, "(R%n%UR%s),R%d", "MOV%u%C%p", armhwby, armfmov, "%I,R%d", /* 48+24 */ @@ -1088,7 +1088,10 @@ format(char *mnemonic, Instr *i, char *f) break; case 'm': - bprint(i, "%lud", (i->w>>7) & 0x1f); + n = (i->w>>7) & 0x1f; + if (n == 0 && (i->w & (3<<5)) != 0) + n = 32; + bprint(i, "%d", n); break; case 'h':