RFR: 8323503: x86: Shorter movptr(reg, imm) for 32-bit unsigned immediates [v3]

Aleksey Shipilev shade at openjdk.org
Thu Jan 11 09:32:21 UTC 2024


On Wed, 10 Jan 2024 20:54:29 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> What about next?:
> 
> ```
> // src should NEVER be a real pointer. Use AddressLiteral for true pointers
> void MacroAssembler::movptr(Address dst, intptr_t src, Register rscratch) {
>   if (is_simm32(src)) {
>     movptr(dst, checked_cast<int32_t>(src));
> ```

Ah, hm! That is the version with `Address dst`. I don't think this zero-extending trick with `movl` and 32-bit destination register works here, because there is no register. We need the affect the full 64-bit of memory, which is what `movptr(Address, int32_t)` -> `movslq` would already give. I don't see any other missing shortcuts here.

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

PR Comment: https://git.openjdk.org/jdk/pull/17343#issuecomment-1886708920


More information about the hotspot-dev mailing list