lw t0 2 gets translated to auipc t0 2 and lw t0 2-pc t0 instead of auipc t0 0 and lw t0 2-pc t0.
This is because the relocation is only used with labels and not with regular immediates I think:
|
Reg_T_S value = getImm(immToken, success, convInfo); |
|
|
|
if (!success) { |
|
// Could not directly resolve immediate. Register it as a symbol to link |
|
// to. |
|
linksWithSymbol.resolveSymbol = applySymbolResolution; |
|
linksWithSymbol.symbol = immToken; |
|
linksWithSymbol.relocation = immToken.relocation(); |
|
return Result<>::def(); |
|
} |
Using an expression such as (2 + 0) works correctly.
lw t0 2gets translated toauipc t0 2andlw t0 2-pc t0instead ofauipc t0 0andlw t0 2-pc t0.This is because the relocation is only used with labels and not with regular immediates I think:
Ripes/src/isa/instruction.h
Lines 652 to 661 in 3a97948
Using an expression such as
(2 + 0)works correctly.