Skip to content

Commit 9b285ff

Browse files
chedahubplafosse
authored andcommitted
Fix PPCVLE I16L-form immediate decoding: use 5-bit mask for ui0_4
1 parent 2763a55 commit 9b285ff

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/powerpc/decode/vle32.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,10 @@ static void FillOperands32Vle(Instruction* instruction, uint32_t word32, uint64_
383383
case PPC_ID_VLE_E_AND2IS:
384384
case PPC_ID_VLE_E_OR2I:
385385
case PPC_ID_VLE_E_OR2IS:
386+
case PPC_ID_VLE_E_LIS:
386387
{
387388
uint32_t ui5_15 = word32 & 0x7ff;
388-
uint32_t ui0_4 = (word32 >> 16) & 0xf;
389+
uint32_t ui0_4 = (word32 >> 16) & 0x1f;
389390
uint32_t ui = (ui0_4 << 11) | ui5_15;
390391

391392
PushRA(instruction, word32);
@@ -622,11 +623,6 @@ static void FillOperands32Vle(Instruction* instruction, uint32_t word32, uint64_
622623
break;
623624
}
624625

625-
case PPC_ID_VLE_E_LIS:
626-
PushRD(instruction, word32);
627-
PushUIMMValue(instruction, ui_split16);
628-
break;
629-
630626
case PPC_ID_VLE_E_MCRF:
631627
PushCRFD(instruction, word32);
632628
PushCRFS(instruction, word32);

0 commit comments

Comments
 (0)