When the immediate encoded in the instruction is accessed, it is sign extended due to being a signed value being assigned to a signed integer. The ISA specifies that this operation is an unsigned operation. The sign extension leads us to incorrectly decode: 801e9c8e: cbf1 sw ra,68(sp) As having an immediate of 1073741809. Since the instruction format does not specify signed/unsigned, and this is currently the only location to use this instuction format, change it to an unsigned immediate.
Showing the changes to arch/mips/include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -981,7 +981,7 @@ struct mm16_r3_format { /* Load from global pointer format */ · 980 unmodified lines | ||
| 981 | 981 | struct mm16_r5_format { /* Load/store from stack pointer format */ |
| 982 | 982 | __BITFIELD_FIELD(unsigned int opcode : 6, |
| 983 | 983 | __BITFIELD_FIELD(unsigned int rt : 5, |
| 984 | − __BITFIELD_FIELD(signed int simmediate : 5, | |
| 984 | + __BITFIELD_FIELD(unsigned int imm : 5, | |
| 985 | 985 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
| 986 | 986 | ;)))) |
| 987 | 987 | }; |