RFR: 8348868: AArch64: Add backend support for SelectFromTwoVector [v15]

Bhavana Kilambi bkilambi at openjdk.org
Wed Jul 16 08:38:49 UTC 2025


On Tue, 15 Jul 2025 12:45:51 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> So the Neon implementation gets kicked in when SVE is not available (UseSVE == 0) whether the vector length is 8 or 16 but we emit Neon instructions for UseSVE ==1 and vector length == 16 only. I am not sure how I can eliminate `UseSVE` here.
>> 
>> When the vector length == 8 with SVE1, we generate the SVE `tbl` instruction (with single input). This is done for `T_INT` and `T_FLOAT` types so that we avoid generating the `mulv`/`addv` instructions for the Neon `tbl` instruction.
>
> But why would the Neon implementation fail if UseSVE ==1? Surely it would still work, and if it still works this comment is wrong.

@theRealAph Thanks for your comments. The Neon implementation would not fail if UseSVE == 1 (Does the comment imply something like this?). Only that we are making a choice of generating Neon instructions for UseSVE = 1 and vec_len = 16. 

The conditions that can reach this method are - UseSVE = 0, 1 with vec_len = 8 or 16 and UseSVE = 2 with any vec_len (based on the conditions in `Matcher::match_rule_supported_vector()`). We have already filtered out `UseSVE = 1` with `vec_len = 8` and `UseSVE = 2` at line #2904. So if the control reaches #2915 then it's either `UseSVE = 0` with any vec_len and `UseSVE = 1` with `vec_len = 16` and that's what the comment mentions.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23570#discussion_r2209676084


More information about the hotspot-compiler-dev mailing list