On Mon, 6 Jul 2026 10:32:51 GMT, Galder Zamarreño <[email protected]> wrote:

>> @galderz Thanks for the review! Yes the test doesn't cover all types, 
>> because these optimizations apply to all types, I only wrote one test for 
>> each optimization pattern, instead of a test for each pattern across all 
>> types. I can extend these tests to all types if you feel it's necessary.
>
>> I can extend these tests to all types if you feel it's necessary.
> 
> The only one that I think might need some investigation is Float16. Have you 
> explored if that type would behave the same way, or maybe there is some work 
> required to make it work? It would be absolutely fine to enhance the test as 
> a follow up, but now could be a good opportunity to explore what is required 
> to make it work.

Hi @galderz @eme64 I have added more JMH and JTReg tests for each optimization 
pattern and each basic vector type.

The updated JMH benchmark test results:

On a Nvidia Grace (Neoverse-V2) machine with 128-bit SVE2:
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40";>

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">

</head>

<body link="#467886" vlink="#96607D">


Benchmark | Unit | Before | Error | After | Error | Uplift
-- | -- | -- | -- | -- | -- | --
blendNegatedMaskByte | ops/ms | 32471.9 | 23.6 | 40150.6 | 41.5 | 1.24
blendNegatedMaskDouble | ops/ms | 4033.9 | 2.5 | 5105.1 | 4.7 | 1.27
blendNegatedMaskFloat | ops/ms | 7992.4 | 4.1 | 10185.5 | 12.3 | 1.27
blendNegatedMaskInt | ops/ms | 7935.2 | 3.5 | 10200.1 | 9.4 | 1.29
blendNegatedMaskLong | ops/ms | 4018.3 | 0.7 | 5095.5 | 4.4 | 1.27
blendNegatedMaskShort | ops/ms | 15476.3 | 11.0 | 20266.6 | 34.1 | 1.31
identityAllOnesByte | ops/ms | 57445.4 | 320.7 | 83214.6 | 1362.6 | 1.45
identityAllOnesDouble | ops/ms | 9459.2 | 5.1 | 12624.9 | 3.2 | 1.33
identityAllOnesFloat | ops/ms | 16292.8 | 9.2 | 24253.0 | 49.3 | 1.49
identityAllOnesInt | ops/ms | 16303.3 | 4.7 | 24288.1 | 33.7 | 1.49
identityAllOnesLong | ops/ms | 9450.5 | 4.9 | 12634.5 | 9.8 | 1.34
identityAllOnesShort | ops/ms | 31362.8 | 82.3 | 45323.0 | 1118.8 | 1.45
identityAllZerosByte | ops/ms | 58036.7 | 48.0 | 81958.0 | 1029.6 | 1.41
identityAllZerosDouble | ops/ms | 9435.7 | 1.4 | 12642.5 | 14.8 | 1.34
identityAllZerosFloat | ops/ms | 16216.5 | 16.5 | 24000.4 | 86.9 | 1.48
identityAllZerosInt | ops/ms | 16234.2 | 15.1 | 24257.6 | 30.1 | 1.49
identityAllZerosLong | ops/ms | 9437.1 | 2.0 | 12625.8 | 6.8 | 1.34
identityAllZerosShort | ops/ms | 30812.6 | 111.7 | 46413.9 | 321.0 | 1.51
nestedBlendInnerByte | ops/ms | 53467.8 | 146.8 | 78783.3 | 1721.3 | 1.47
nestedBlendInnerDouble | ops/ms | 8127.5 | 3.2 | 12384.6 | 1.7 | 1.52
nestedBlendInnerFloat | ops/ms | 15108.3 | 67.0 | 23265.4 | 30.8 | 1.54
nestedBlendInnerInt | ops/ms | 15255.8 | 23.9 | 23338.5 | 35.7 | 1.53
nestedBlendInnerLong | ops/ms | 8125.4 | 2.6 | 12360.7 | 15.7 | 1.52
nestedBlendInnerShort | ops/ms | 28790.6 | 282.8 | 44740.1 | 530.1 | 1.55
nestedBlendOuterByte | ops/ms | 53583.0 | 122.1 | 78840.0 | 1454.9 | 1.47
nestedBlendOuterDouble | ops/ms | 8105.0 | 2.1 | 12383.0 | 2.1 | 1.53
nestedBlendOuterFloat | ops/ms | 15173.0 | 3.3 | 23229.3 | 44.4 | 1.53
nestedBlendOuterInt | ops/ms | 15272.2 | 7.6 | 23360.2 | 131.3 | 1.53
nestedBlendOuterLong | ops/ms | 8103.1 | 8.4 | 12360.3 | 18.2 | 1.53
nestedBlendOuterShort | ops/ms | 28979.7 | 293.3 | 44675.7 | 551.7 | 1.54



</body>

</html>

On an AWS Graviton3 (Neoverse-V1) machine with 256-bit SVE1:
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40";>

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">

</head>

<body link="#467886" vlink="#96607D">


Benchmark | Unit | Before | Error | After | Error | Uplift
-- | -- | -- | -- | -- | -- | --
blendNegatedMaskByte | ops/ms | 20231.9 | 79.2 | 31905.8 | 114.4 | 1.58
blendNegatedMaskDouble | ops/ms | 2635.8 | 4.3 | 4075.6 | 12.2 | 1.55
blendNegatedMaskFloat | ops/ms | 5143.2 | 17.0 | 7994.9 | 19.9 | 1.55
blendNegatedMaskInt | ops/ms | 5188.4 | 4.3 | 7993.9 | 29.7 | 1.54
blendNegatedMaskLong | ops/ms | 2618.3 | 7.6 | 4135.3 | 24.6 | 1.58
blendNegatedMaskShort | ops/ms | 10611.4 | 81.2 | 16321.8 | 100.9 | 1.54
identityAllOnesByte | ops/ms | 40605.9 | 1798.0 | 67320.7 | 4079.5 | 1.66
identityAllOnesDouble | ops/ms | 5959.6 | 6.1 | 9992.1 | 5.4 | 1.68
identityAllOnesFloat | ops/ms | 11485.8 | 107.8 | 18870.7 | 82.8 | 1.64
identityAllOnesInt | ops/ms | 11627.5 | 67.7 | 18863.0 | 33.8 | 1.62
identityAllOnesLong | ops/ms | 5975.5 | 4.4 | 9975.8 | 20.4 | 1.67
identityAllOnesShort | ops/ms | 22729.0 | 158.2 | 34838.9 | 723.2 | 1.53
identityAllZerosByte | ops/ms | 43273.1 | 78.1 | 67324.8 | 4039.4 | 1.56
identityAllZerosDouble | ops/ms | 5943.6 | 4.2 | 9996.0 | 7.4 | 1.68
identityAllZerosFloat | ops/ms | 11321.4 | 70.4 | 18924.4 | 40.8 | 1.67
identityAllZerosInt | ops/ms | 11576.2 | 12.0 | 18908.9 | 16.7 | 1.63
identityAllZerosLong | ops/ms | 5989.2 | 11.6 | 9960.9 | 20.7 | 1.66
identityAllZerosShort | ops/ms | 21108.7 | 279.0 | 35881.5 | 1635.3 | 1.70
nestedBlendInnerByte | ops/ms | 39105.0 | 507.6 | 60490.5 | 229.3 | 1.55
nestedBlendInnerDouble | ops/ms | 5783.9 | 16.9 | 9824.6 | 2.4 | 1.70
nestedBlendInnerFloat | ops/ms | 10865.5 | 21.1 | 18376.3 | 61.8 | 1.69
nestedBlendInnerInt | ops/ms | 11176.8 | 16.7 | 18658.7 | 107.1 | 1.67
nestedBlendInnerLong | ops/ms | 5790.8 | 10.2 | 9817.4 | 6.8 | 1.70
nestedBlendInnerShort | ops/ms | 20236.0 | 48.8 | 35086.6 | 926.8 | 1.73
nestedBlendOuterByte | ops/ms | 39176.1 | 541.8 | 64135.3 | 3477.3 | 1.64
nestedBlendOuterDouble | ops/ms | 5760.3 | 0.7 | 9822.9 | 2.4 | 1.71
nestedBlendOuterFloat | ops/ms | 10999.9 | 103.7 | 18598.9 | 69.3 | 1.69
nestedBlendOuterInt | ops/ms | 11217.9 | 14.0 | 18582.6 | 37.6 | 1.66
nestedBlendOuterLong | ops/ms | 5805.2 | 10.4 | 9778.4 | 38.6 | 1.68
nestedBlendOuterShort | ops/ms | 20813.4 | 457.3 | 36167.5 | 769.9 | 1.74



</body>

</html>

On a Nvidia Grace (Neoverse-V2) machine with `-XX:UseSVE=0`:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40";>

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">

</head>

<body link="#467886" vlink="#96607D">


Benchmark | Unit | Before | Error | After | Error | Uplift
-- | -- | -- | -- | -- | -- | --
blendNegatedMaskByte | ops/ms | 25777.7 | 27.8 | 54647.2 | 496.1 | 2.12
blendNegatedMaskDouble | ops/ms | 2835.9 | 2.0 | 2862.5 | 11.9 | 1.01
blendNegatedMaskFloat | ops/ms | 6454.7 | 7.2 | 9239.3 | 11.8 | 1.43
blendNegatedMaskInt | ops/ms | 7460.9 | 10.6 | 9250.2 | 7.1 | 1.24
blendNegatedMaskLong | ops/ms | 2854.5 | 3.4 | 2856.8 | 2.0 | 1.00
blendNegatedMaskShort | ops/ms | 18268.6 | 10.7 | 19091.4 | 54.5 | 1.05
identityAllOnesByte | ops/ms | 56734.8 | 186.6 | 85332.4 | 4096.3 | 1.50
identityAllOnesDouble | ops/ms | 8357.3 | 17.5 | 12592.8 | 10.1 | 1.51
identityAllOnesFloat | ops/ms | 15928.8 | 14.8 | 24185.1 | 17.8 | 1.52
identityAllOnesInt | ops/ms | 15953.3 | 24.3 | 23885.2 | 52.5 | 1.50
identityAllOnesLong | ops/ms | 8336.4 | 10.2 | 12585.5 | 16.4 | 1.51
identityAllOnesShort | ops/ms | 30797.6 | 42.3 | 45047.2 | 874.4 | 1.46
identityAllZerosByte | ops/ms | 57303.3 | 217.4 | 85184.5 | 4292.4 | 1.49
identityAllZerosDouble | ops/ms | 8347.6 | 10.5 | 12589.9 | 11.1 | 1.51
identityAllZerosFloat | ops/ms | 16030.2 | 106.2 | 24268.5 | 59.9 | 1.51
identityAllZerosInt | ops/ms | 15991.8 | 76.8 | 24064.5 | 139.8 | 1.50
identityAllZerosLong | ops/ms | 8392.6 | 48.3 | 12578.8 | 14.4 | 1.50
identityAllZerosShort | ops/ms | 30684.4 | 147.7 | 45719.3 | 744.9 | 1.49
nestedBlendInnerByte | ops/ms | 37403.2 | 148.9 | 82374.9 | 1684.9 | 2.20
nestedBlendInnerDouble | ops/ms | 4716.0 | 5.9 | 12449.4 | 8.0 | 2.64
nestedBlendInnerFloat | ops/ms | 9335.2 | 8.5 | 23701.3 | 127.9 | 2.54
nestedBlendInnerInt | ops/ms | 9330.2 | 6.1 | 23477.1 | 43.5 | 2.52
nestedBlendInnerLong | ops/ms | 4713.4 | 5.7 | 12417.0 | 13.5 | 2.63
nestedBlendInnerShort | ops/ms | 18559.4 | 26.5 | 42579.5 | 263.0 | 2.29
nestedBlendOuterByte | ops/ms | 37378.3 | 36.8 | 82685.7 | 1720.5 | 2.21
nestedBlendOuterDouble | ops/ms | 4724.1 | 2.7 | 12446.0 | 11.1 | 2.63
nestedBlendOuterFloat | ops/ms | 9338.6 | 5.1 | 23707.1 | 110.4 | 2.54
nestedBlendOuterInt | ops/ms | 9363.2 | 12.0 | 23438.8 | 62.4 | 2.50
nestedBlendOuterLong | ops/ms | 4721.8 | 3.1 | 12424.3 | 11.6 | 2.63
nestedBlendOuterShort | ops/ms | 18622.2 | 30.1 | 43359.2 | 106.1 | 2.33



</body>

</html>


On an AMD EPYC 9124 16-Core Processor with option `-XX:UseAVX=3`:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40";>

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">

</head>

<body link="#467886" vlink="#96607D">


Benchmark | Unit | Before | Error | After | Error | Uplift
-- | -- | -- | -- | -- | -- | --
blendNegatedMaskByte | ops/ms | 67407.8 | 412.8 | 69424.5 | 2106.5 | 1.03
blendNegatedMaskDouble | ops/ms | 11152.4 | 125.3 | 11188.3 | 92.1 | 1.00
blendNegatedMaskFloat | ops/ms | 21574.8 | 337.2 | 21488.0 | 463.8 | 1.00
blendNegatedMaskInt | ops/ms | 21781.1 | 727.6 | 19572.9 | 1426.9 | 0.90
blendNegatedMaskLong | ops/ms | 10700.7 | 16.0 | 10759.0 | 18.4 | 1.01
blendNegatedMaskShort | ops/ms | 39436.1 | 5685.7 | 34800.4 | 2114.8 | 0.88
identityAllOnesByte | ops/ms | 66285.3 | 11739.9 | 110604.2 | 159.4 | 1.67
identityAllOnesDouble | ops/ms | 9583.0 | 42.8 | 11212.1 | 79.9 | 1.17
identityAllOnesFloat | ops/ms | 19443.9 | 140.0 | 22505.7 | 89.2 | 1.16
identityAllOnesInt | ops/ms | 19039.8 | 169.1 | 19504.0 | 1477.1 | 1.02
identityAllOnesLong | ops/ms | 9659.6 | 59.9 | 11017.5 | 121.9 | 1.14
identityAllOnesShort | ops/ms | 42620.9 | 121.8 | 47672.9 | 8153.5 | 1.12
identityAllZerosByte | ops/ms | 78145.5 | 248.6 | 110525.2 | 228.7 | 1.41
identityAllZerosDouble | ops/ms | 9343.5 | 33.6 | 11212.4 | 76.7 | 1.20
identityAllZerosFloat | ops/ms | 18139.7 | 443.1 | 22528.6 | 26.1 | 1.24
identityAllZerosInt | ops/ms | 18718.9 | 70.7 | 19938.5 | 297.3 | 1.07
identityAllZerosLong | ops/ms | 9271.3 | 77.8 | 11276.6 | 33.6 | 1.22
identityAllZerosShort | ops/ms | 36981.9 | 3574.9 | 47674.5 | 8080.1 | 1.29
nestedBlendInnerByte | ops/ms | 69264.5 | 3372.6 | 106047.9 | 1016.9 | 1.53
nestedBlendInnerDouble | ops/ms | 9492.4 | 50.0 | 11124.5 | 89.7 | 1.17
nestedBlendInnerFloat | ops/ms | 18757.8 | 297.9 | 22196.8 | 346.9 | 1.18
nestedBlendInnerInt | ops/ms | 18585.4 | 176.3 | 20720.7 | 888.8 | 1.11
nestedBlendInnerLong | ops/ms | 9476.7 | 17.2 | 10987.1 | 154.6 | 1.16
nestedBlendInnerShort | ops/ms | 30350.9 | 103.2 | 49816.7 | 6039.3 | 1.64
nestedBlendOuterByte | ops/ms | 72010.3 | 670.7 | 105785.8 | 721.9 | 1.47
nestedBlendOuterDouble | ops/ms | 9557.9 | 44.7 | 11227.9 | 57.0 | 1.17
nestedBlendOuterFloat | ops/ms | 18725.7 | 104.5 | 21778.4 | 340.6 | 1.16
nestedBlendOuterInt | ops/ms | 19108.5 | 137.6 | 21627.9 | 867.6 | 1.13
nestedBlendOuterLong | ops/ms | 9469.3 | 23.7 | 11242.9 | 38.5 | 1.19
nestedBlendOuterShort | ops/ms | 33013.1 | 2718.4 | 49708.4 | 5879.0 | 1.51



</body>

</html>


On an AMD EPYC 9124 16-Core Processor with option `-XX:UseAVX=2`:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40";>

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/erfang/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">

</head>

<body link="#467886" vlink="#96607D">


Benchmark | Unit | Before | Error | After | Error | Uplift
-- | -- | -- | -- | -- | -- | --
blendNegatedMaskByte | ops/ms | 49074.1 | 359.8 | 53408.2 | 210.5 | 1.09
blendNegatedMaskDouble | ops/ms | 6938.6 | 54.9 | 7707.8 | 91.6 | 1.11
blendNegatedMaskFloat | ops/ms | 13360.7 | 86.6 | 14908.9 | 77.9 | 1.12
blendNegatedMaskInt | ops/ms | 13221.8 | 75.1 | 15129.9 | 49.9 | 1.14
blendNegatedMaskLong | ops/ms | 6792.6 | 183.5 | 7753.7 | 30.9 | 1.14
blendNegatedMaskShort | ops/ms | 25330.1 | 189.6 | 27826.6 | 265.1 | 1.10
identityAllOnesByte | ops/ms | 60759.4 | 298.4 | 82547.1 | 169.8 | 1.36
identityAllOnesDouble | ops/ms | 6779.4 | 85.1 | 9272.2 | 9.2 | 1.37
identityAllOnesFloat | ops/ms | 13447.0 | 202.3 | 18004.2 | 502.8 | 1.34
identityAllOnesInt | ops/ms | 13322.7 | 246.6 | 18048.8 | 417.5 | 1.35
identityAllOnesLong | ops/ms | 6728.5 | 136.0 | 9276.9 | 5.0 | 1.38
identityAllOnesShort | ops/ms | 30342.2 | 1717.1 | 38753.1 | 2462.3 | 1.28
identityAllZerosByte | ops/ms | 60616.7 | 452.7 | 82653.3 | 48.7 | 1.36
identityAllZerosDouble | ops/ms | 6696.9 | 86.9 | 9273.5 | 5.7 | 1.38
identityAllZerosFloat | ops/ms | 13246.1 | 190.6 | 18559.4 | 12.3 | 1.40
identityAllZerosInt | ops/ms | 13367.9 | 268.7 | 17625.1 | 438.6 | 1.32
identityAllZerosLong | ops/ms | 6600.4 | 86.5 | 9058.1 | 106.0 | 1.37
identityAllZerosShort | ops/ms | 31499.0 | 116.0 | 36147.7 | 2406.2 | 1.15
nestedBlendInnerByte | ops/ms | 44511.5 | 335.6 | 82595.5 | 132.2 | 1.86
nestedBlendInnerDouble | ops/ms | 6081.6 | 68.2 | 9272.5 | 6.1 | 1.52
nestedBlendInnerFloat | ops/ms | 12350.7 | 100.7 | 18527.2 | 48.2 | 1.50
nestedBlendInnerInt | ops/ms | 12235.7 | 91.1 | 18010.8 | 509.0 | 1.47
nestedBlendInnerLong | ops/ms | 5920.5 | 31.3 | 9235.7 | 24.0 | 1.56
nestedBlendInnerShort | ops/ms | 23882.2 | 228.0 | 38746.4 | 2467.0 | 1.62
nestedBlendOuterByte | ops/ms | 43195.5 | 958.1 | 73987.2 | 8304.4 | 1.71
nestedBlendOuterDouble | ops/ms | 6096.2 | 93.9 | 9291.1 | 12.7 | 1.52
nestedBlendOuterFloat | ops/ms | 12270.7 | 113.5 | 18570.0 | 8.0 | 1.51
nestedBlendOuterInt | ops/ms | 12202.3 | 67.6 | 18046.9 | 516.4 | 1.48
nestedBlendOuterLong | ops/ms | 6069.6 | 109.6 | 9275.2 | 21.1 | 1.53
nestedBlendOuterShort | ops/ms | 23876.8 | 185.3 | 38799.7 | 2479.3 | 1.62



</body>

</html>

Few cases showed regression, which I believe was caused by fluctuations.

And I also tested `compiler/vectorapi/VectorExpressionFuzzer.java?` on 
different machines with different configuration, 200 times, all test passed.

Please help take another look when you have a chance, thanks~

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

PR Comment: https://git.openjdk.org/jdk/pull/31333#issuecomment-4977788062

Reply via email to