NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.07k stars 5.82k forks source link

VLE load/store instructions are shown with incorrect index #5245

Closed amatus closed 8 months ago

amatus commented 1 year ago

Describe the bug VLE word and half-word load/store instructions are shown with incorrect index. The index needs to be shifted so it's a multiple of 4 (word) or 2 (half-word). For example:

           c3 31           se_lwz     r3,0x3(r1)

should be se_lwz r3,0xc(r1). This affects: se_lwz, se_lhz, se_stw, and se_sth.

Environment (please complete the following information):

GhidorahRex commented 1 year ago

This is a display bug more than anything else - although that's not great regardless. Should be a quick and easy fix. I'll try to get it in soon.

Replace:

sd4HPlusRxAddr: SD4_VLE(RX_VLE) is SD4_VLE & RX_VLE             {tmp:$(REGISTER_SIZE) = RX_VLE+(SD4_VLE << 1); export tmp;  }
sd4WPlusRxAddr: SD4_VLE(RX_VLE) is SD4_VLE & RX_VLE             {tmp:$(REGISTER_SIZE) = RX_VLE+(SD4_VLE << 2); export tmp;  }

with

sd4HPlusRxAddr: SD4_OFF(RX_VLE) is SD4_VLE & RX_VLE     [SD4_OFF = SD4_VLE << 1;] {tmp:$(REGISTER_SIZE) = RX_VLE+(SD4_VLE << 1); export tmp;  }
sd4WPlusRxAddr: SD4_OFF(RX_VLE) is SD4_VLE & RX_VLE     [SD4_OFF = SD4_VLE << 2;] {tmp:$(REGISTER_SIZE) = RX_VLE+(SD4_VLE << 2); export tmp;  }