RFR: 8364305: Support AVX10 saturating floating point conversion instructions [v2]
Jatin Bhateja
jbhateja at openjdk.org
Wed Sep 10 18:15:18 UTC 2025
On Sat, 6 Sep 2025 00:28:18 GMT, Mohamed Issa <missa at openjdk.org> wrote:
>>> @missa-prime Looks like an interesting patch! Do you think you could add some sort of IR test here, to verify that the correct code is generated on AVX10 vs lower AVX?
>>
>> @eme64 Thanks for the suggestion. This patch doesn't modify any IR though, so I'm not sure what IR test(s) to add. I could modify existing tests (`test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java`, `test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java`, `test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java`) that use IR nodes as dependencies though. Would that be sufficient? Or did you have something else in mind?
>
>> @missa-prime Could you not match on the mach graph? See example: `test/hotspot/jtreg/compiler/vectorapi/VectorMultiplyOpt.java` with `CompilePhase.FINAL_CODE`.
>>
>> Maybe another `CompilePhase` is better. I have never matched on the mach graph myself, but I wonder if it may be useful here.
>
> I modified existing vector conversion tests, and I'll add some matching scalar tests to get full coverage.
@missa-prime , please have a look at the following failure with the current patch
2025-09-10T02:04:00.8424130Z
2025-09-10T02:04:00.8424221Z Failed IR Rules (4) of Methods (4)
2025-09-10T02:04:00.8424462Z ----------------------------------
2025-09-10T02:04:00.8425011Z 1) Method "public char[] compiler.vectorization.runner.ArrayTypeConvertTest.convertDoubleToChar()" - [Failed IR rules: 1]:
2025-09-10T02:04:00.8426351Z * @IR rule 3: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#CAST_D2X#_", "> 0"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={"avx", "true", "avx10_2", "false"}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
2025-09-10T02:04:00.8427967Z > Phase "Final Code":
2025-09-10T02:04:00.8428412Z - counts: Graph contains wrong number of nodes:
2025-09-10T02:04:00.8429037Z * Constraint 1: "(\d+(\s){2}(castD2X_reg_(av|eve)x.*)+(\s){2}===.*)"
2025-09-10T02:04:00.8429650Z - Failed comparison: [found] 0 > 0 [given]
2025-09-10T02:04:00.8430146Z - No nodes matched!
2025-09-10T02:04:00.8430409Z
2025-09-10T02:04:00.8431165Z 2) Method "public int[] compiler.vectorization.runner.ArrayTypeConvertTest.convertDoubleToInt()" - [Failed IR rules: 1]:
2025-09-10T02:04:00.8433283Z * @IR rule 2: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#CAST_D2X#_", "> 0"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={"avx", "true", "avx10_2", "false"}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
2025-09-10T02:04:00.8434546Z > Phase "Final Code":
2025-09-10T02:04:00.8434810Z - counts: Graph contains wrong number of nodes:
2025-09-10T02:04:00.8435174Z * Constraint 1: "(\d+(\s){2}(castD2X_reg_(av|eve)x.*)+(\s){2}===.*)"
2025-09-10T02:04:00.8435523Z - Failed comparison: [found] 0 > 0 [given]
2025-09-10T02:04:00.8435792Z - No nodes matched!
2025-09-10T02:04:00.8435937Z
2025-09-10T02:04:00.8436340Z 3) Method "public short[] compiler.vectorization.runner.ArrayTypeConvertTest.convertDoubleToShort()" - [Failed IR rules: 1]:
2025-09-10T02:04:00.8437688Z * @IR rule 3: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#CAST_D2X#_", "> 0"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={"avx", "true", "avx10_2", "false"}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
2025-09-10T02:04:00.8438703Z > Phase "Final Code":
2025-09-10T02:04:00.8438956Z - counts: Graph contains wrong number of nodes:
2025-09-10T02:04:00.8439301Z * Constraint 1: "(\d+(\s){2}(castD2X_reg_(av|eve)x.*)+(\s){2}===.*)"
2025-09-10T02:04:00.8439647Z - Failed comparison: [found] 0 > 0 [given]
2025-09-10T02:04:00.8439913Z - No nodes matched!
2025-09-10T02:04:00.8440063Z
2025-09-10T02:04:00.8440436Z 4) Method "public int[] compiler.vectorization.runner.ArrayTypeConvertTest.convertFloatToInt()" - [Failed IR rules: 1]:
2025-09-10T02:04:00.8441891Z * @IR rule 2: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#CAST_F2X#_", "> 0"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={"avx", "true", "avx10_2", "false"}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={}, applyIfNot={})"
2025-09-10T02:04:00.8442912Z > Phase "Final Code":
2025-09-10T02:04:00.8443155Z - counts: Graph contains wrong number of nodes:
2025-09-10T02:04:00.8443492Z * Constraint 1: "(\d+(\s){2}(castF2X_reg_(av|eve)x.*)+(\s){2}===.*)"
2025-09-10T02:04:00.8443951Z - Failed comparison: [found] 0 > 0 [given]
2025-09-10T02:04:00.8444210Z - No nodes matched!
2025-09-10T02:04:00.8444355Z
2025-09-10T02:04:00.8444498Z >>> Check stdout for compilation output of the failed methods
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26919#issuecomment-3276020517
More information about the hotspot-compiler-dev
mailing list