RFR: 8319822: Use a linear-time algorithm for assert_different_registers() [v12]

Thomas Stuefe stuefe at openjdk.org
Mon Jun 3 16:57:05 UTC 2024


On Mon, 3 Jun 2024 16:47:00 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> I just changed the static assert to a regular assert, in the hope that it might work better on arm32.
>
> Urgh. 
> 
> Seems on arm32 (and on zero, but I guess that does not matter) Register is a typedef to a pointer:
> 
> https://github.com/openjdk/jdk/blob/9686e804a2b058955ff88149c54a0a7896c0a2eb/src/hotspot/cpu/arm/register_arm.hpp#L136
> 
> and RegImpl is a pointer type, so it cannot have members.
> 
> On all other platforms, Register is a class (and that works since it overrides operator->() )
> 
> I don't see a quick fix other than to make the assert dependent on !arm !zero. Or, leave it for a followup fix.
> 
> ---
> 
> BTW, note that on Arm32, we can have 64 float registers:
> 
> https://github.com/openjdk/jdk/blob/9686e804a2b058955ff88149c54a0a7896c0a2eb/src/hotspot/cpu/arm/register_arm.hpp#L178
> 
> So, I would make the underlying type 64-bit for 32-bit builds too.

BTW Would the runtime assert not prevent this from used as constexpr?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16617#discussion_r1624776615


More information about the hotspot-compiler-dev mailing list