[PPC] Fix #2401 - incorrect operands in disassembled instructions #2403
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.
Your checklist for this pull request
Detailed description
Disassembling the "slwi", "srwi" and "rldicr" PowerPC instructions with the "-d" option displays the wrong operands in detailed information. This is due to an incorrect break condition in PPC_insert_detail_op_imm_at()
Test plan
$ cstool -d ppc32be 786226e4 0 78 62 26 e4 sldi r2, r3, 4 ID: 868 (rldicr) Is alias: 2329 (sldi) with ALIAS operand set op_count: 3 operands[0].type: REG = r2 operands[0].access: WRITE operands[1].type: REG = r2 operands[1].access: WRITE operands[2].type: IMM = 0x4 operands[2].access: READ
$ cstool -d ppc32be 786226e4 0 78 62 26 e4 sldi r2, r3, 4 ID: 868 (rldicr) Is alias: 2329 (sldi) with ALIAS operand set op_count: 3 operands[0].type: REG = r2 operands[0].access: WRITE operands[1].type: REG = r3 operands[1].access: READ operands[2].type: IMM = 0x4 operands[2].access: READ
Please let me know if this should be added in the testsuite too. I am not sure how one does that.
Closing issues
closes #2401