RFR: 8287418: riscv: Fix correctness issue of MacroAssembler::movptr [v3]

Xiaolin Zheng xlinzheng at openjdk.java.net
Fri May 27 07:24:49 UTC 2022


On Fri, 27 May 2022 06:59:04 GMT, Xiaolin Zheng <xlinzheng at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1187:
>> 
>>> 1185:   int64_t upper = ((intptr_t)target - lower) >> 29;
>>> 1186:   Assembler::patch(branch + 0,  31, 12, upper & 0xfffff);                       // Lui.             target[47:28] + target[27] ==> branch[31:12]
>>> 1187:   Assembler::patch(branch + 4,  31, 20, (lower >> 17) & 0xfff);                 // Addiw.           target[27:16] ==> branch[31:20]
>> 
>> `Addiw` -> `Addi`
>> 
>> Are these comments still right? 
>> 
>> target[27:16] ==> branch[31:20]
>> target[15: 5] ==> branch[31:20]
>> target[ 4: 0] ==> branch[31:20]
>
> Oh, thank you. My IDE prevents me from seeing the latter comments (the lines are a bit long). I would change that.

Comments fixed. Would you please have another review of the change?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8913


More information about the hotspot-compiler-dev mailing list