RFR: 8294729: [s390] Implement nmethod entry barriers

Lutz Schmidt lucy at openjdk.org
Wed Oct 26 20:00:41 UTC 2022


On Tue, 11 Oct 2022 15:27:44 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

>> You are right. There are no "speaking" aliases for brc. "Branch on Condition" is not used frequently in VM code. Therefore, nobody felt enough pain so far to define the aliases.
>> May I please request you use the condition `Assembler::bcondNotZero`? `LTR` compares the register value against zero.
>
> I'm happy to change bcondNotEqual -> bcondNotZero, especially since it seems to more clearly represent the intent. Thanks for the suggestion.
> 
> Out of curiosity: How are they different? You mentioned above that there are semantic differences between not equal and not zero, but in assembler_s390.hpp, it looks like bcondNotZero is actually an alias for bcondNotEqual.

You are right. The two conditions are technically identical. There is a semantic difference. If you say "NotEqual", you imply that you compared two (arbitrary) values. If you say "NotZero", it is clear that you tested the value against zero. When you use LTR to test a value and copy it at the same time, it may be confusing for the not so profound s390 hacker. Example:

z_ltr(Z_R1, Z_R2);
z_bcr(Assembler::bcondNotEqual, R14);

Was the contents of the registers compared before r2 was copied into r1? For sure not, you say. But that's because you are a profound s390 hacker meanwhile. :-)

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

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


More information about the hotspot-dev mailing list