RFR: 8288047: Accelerate Poly1305 on x86_64 using AVX512 instructions [v6]

Vladimir Ivanov vlivanov at openjdk.org
Wed Nov 9 00:42:32 UTC 2022


On Tue, 8 Nov 2022 22:01:19 GMT, Volodymyr Paprotski <duke at openjdk.org> wrote:

> Did not split it up into individual constants. The main 'problem' is that Address and ExternalAddress are not compatible. 

There's a reason for that and it's because RIP-relative addressing doesn't always work, so additional register may be needed.

> Most instructions do not take AddressLiteral, so can't use ExternalAddress to refer to those constants. 

I counted 4 instructions accessing the constants (`evpandq`, `andq`, `evporq`, and `vpternlogq`) in your patch. 

`macroAssembler_x86.hpp` is the place for `AddressLiteral`-related overloads (there are already numerous cases present) and it's trivial to add new ones. 

> (If I did get the instructions I use to take AddressLiteral, I think we would end up with more lea(rscratch)s generated; but that's more of a silver-lining)

It depends on memory layout. If constants end up placed close enough in the address space, there'll be no additional instructions generated.

Anyway, it doesn't look like something important from throughput perspective. Overall, I find it clearer when the code refers to individual constants through `AddressLiteral`s, but I'm also fine with it as it is now.

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

PR: https://git.openjdk.org/jdk/pull/10582


More information about the hotspot-dev mailing list