Commit 195eb910 authored by Connor Abbott's avatar Connor Abbott

figured out register bit

Turns out that the low bit of reg1 is actually an extra bit for reg1
when it's acting as the register access descriptor/control. This lets
you access all 64 registers when reg1 is disabled.
parent 86585a56
......@@ -48,8 +48,6 @@ static RegCtrl DecodeRegCtrl(Regs regs)
if (regs.ctrl == 0) {
ctrl = regs.reg1 >> 2;
decoded.readReg0 = !(regs.reg1 & 0x2);
if ((regs.reg1 & 0x1))
printf("# unknown regctrl bit set\n");
decoded.readReg1 = false;
} else {
ctrl = regs.ctrl;
......@@ -142,7 +140,13 @@ static void DumpConstImm(uint32_t imm)
static void DumpSrc(unsigned src, Regs srcs, uint64_t *consts, bool isFMA)
{
switch (src) {
case 0: printf("R%d", srcs.reg0); break;
case 0: {
unsigned reg = srcs.reg0;
if (srcs.ctrl == 0)
reg |= (srcs.reg1 & 1) << 5;
printf("R%d", reg);
break;
}
case 1: printf("R%d", srcs.reg1); break;
case 2: printf("R%d", srcs.reg3); break;
case 3:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment