[PPCVLE] Correct si_split16 immediate decoding for I16A-form instructions #7552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug where the 16-bit signed immediate (si_split16) for VLE I16A-form instructions (e.g., e_add2i, e_add2is, e_mull2i, e_cmp16i, e_cmph16i, e_cmpl16i, e_cmphl16i) was decoded incorrectly.
The Bug
The upper 5 bits of the immediate (ui0_4) were being extracted from the wrong field in the instruction word. The code was using (

word32 >> 16), which reads from the rD register field, instead of the correct (word32 >> 21).The Fix
Modified vle32.c in the FillOperands32Vle function:

Changed the bit shift for ui0_4 from
>>16to>>21.This ensures the si_split16 immediate value is now calculated correctly for all I16A-form instructions.