Closed jopperm closed 2 years ago
As reported by @wysiwyng in https://github.com/Minres/CoreDSL/issues/58, casting an unsigned value (such as an encoding field) to a signed type does not sign-extend the value (because the source type is unsigned).
https://github.com/Minres/RISCV_ISA_CoreDSL/blob/726fb8117b47714ee891f89032fb8a9ce167b1e2/RV32I.core_desc#L9-L13
(There might be other occurrences of this pattern.)
Correct form would be:
X[rd % RFS] = (unsigned<XLEN>) ((signed) imm));
As reported by @wysiwyng in https://github.com/Minres/CoreDSL/issues/58, casting an unsigned value (such as an encoding field) to a signed type does not sign-extend the value (because the source type is unsigned).
https://github.com/Minres/RISCV_ISA_CoreDSL/blob/726fb8117b47714ee891f89032fb8a9ce167b1e2/RV32I.core_desc#L9-L13
(There might be other occurrences of this pattern.)