Project

General

Profile

Actions

Emulator Issues #11528

open

Debugger displays wrong bitmask

Added by nwplayer123 almost 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

I've run into an instruction (rlwimi r6, r7, 16, 6, 15) that displays the wrong bitmask, debugger shows it as 0x000003FF when it should be 0x03FF0000 (bits 6-15), I've tracked it down to this line, with HelperRotateMask. I'm not sure if it's the disassembler or the interpreter too but it's worth double checking, rlwinm/rlwimi is a pain. Instruction opcode is 0x50E6819E, used in every GameCube game in MEMIntrruptHandler+0x2C
https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Common/GekkoDisassembler.cpp#L615


Files

Screenshot_76.png (34.1 KB) Screenshot_76.png nwplayer123, 01/15/2019 12:47 AM
Actions #1

Updated by taolas almost 6 years ago

12345678 rl 16 -> 56781234 wimi 6, 15 -> 06780000 (678 = 3FF).

Therefore unscrambled: a mask 3FF is applied to 678 = 000003FF. It's correct, as it takes the rotation into account. You just did the mask. Using the rotation and mask is good because you can look at the original hex and immediately know what's being masked.

Actions #2

Updated by nwplayer123 almost 6 years ago

Should still be 0x03FF0000, upper halfword is 0x4022, lower halfword is 0x4024, that's how it gets this address, insert 10 bits at bit 6(to 15)
https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/HW/MemoryInterface.cpp#L115

Actions #3

Updated by taolas almost 6 years ago

Insert what 10 bits? Isn't the helper consistently showing the what and not the where to?
What would you expect rlwimi r6, r7, 20, 6, 15 to show, the same 0x03FF0000?

I could be wrong here, but it seems to be consistent with what it's showing.

Actions #4

Updated by nwplayer123 almost 6 years ago

oh, yeah, I guess that's what I'm thinking of. I'm expecting the where to and not the what. insrwi is just the simplified opcode for that rlwimi, insert right word immediate. I'm expecting it to be 0x03FF0000 cuz it overwrites those bits in r6 vs what it takes from r7.

Actions

Also available in: Atom PDF