On Sat, 28 Feb 2026 00:07:15 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> I ran following code with `-Djdk.incubator.vector.DEBUG=true`, however it 
>> was not intrinsified.
>> 
>> 
>>   public static void cos(){
>>     var rand = new Random();
>>     for(int i = 0; i < 1_000_000; i++){
>>       var vec = DoubleVector.fromArray(DoubleVector.SPECIES_256, 
>> rand.doubles().limit(4).toArray(), 0);
>> 
>>       vec.lanewise(VectorOperators.COS);
>>     }
>>   }
>> 
>> 
>> I knew `__jsvml_cos4_ha_l9()` in libjsvml.so should be called in this case 
>> (via vector debug log), but it was not hitted even though I set breakpoint 
>> in it.
>> 
>> `LaneType` has been introduced in 
>> [JDK-8376187](https://bugs.openjdk.org/browse/JDK-8376187), and 
>> `LibraryCallKit::inline_vector_call()` was updated to handle lane type 
>> rather than class of element type. However `VectorMathLibrary` wasn't 
>> modified.
>> 
>> I confirmed `__jsvml_cos4_ha_l9()` is called with this fix, and also all 
>> jdk/jdk/incubator/vector jtreg tests passed on Linux AMD64.
>
> Yasumasa Suenaga has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Rename testcase

> I confirmed following patch fixes the problem, and the test passed. May I 
> send PR?
> 
> ```diff
> diff --git 
> a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template
>  
> b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template
> index d6763c2c03a..95fe8ca35db 100644
> --- 
> a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template
> +++ 
> b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template
> @@ -772,7 +772,7 @@ public abstract class $abstractvectortype$ extends 
> AbstractVector<$Boxtype$> {
>      @ForceInline
>      final
>      $abstractvectortype$ unaryMathOp(VectorOperators.Unary op) {
> -        return VectorMathLibrary.unaryMathOp(op, opCode(op), species(), 
> $abstractvectortype$::unaryOperations,
> +        return VectorMathLibrary.unaryMathOp(op, opCode(op), vspecies(), 
> $abstractvectortype$::unaryOperations,
>                                               this);
>      }
>  #end[FP]
> @@ -983,7 +983,7 @@ public abstract class $abstractvectortype$ extends 
> AbstractVector<$Boxtype$> {
>      @ForceInline
>      final
>      $abstractvectortype$ binaryMathOp(VectorOperators.Binary op, 
> $abstractvectortype$ that) {
> -        return VectorMathLibrary.binaryMathOp(op, opCode(op), species(), 
> $abstractvectortype$::binaryOperations,
> +        return VectorMathLibrary.binaryMathOp(op, opCode(op), vspecies(), 
> $abstractvectortype$::binaryOperations,
>                                                this, that);
>      }
>  #end[FP]
> ```

Kindly approve https://github.com/openjdk/jdk/pull/30012

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

PR Comment: https://git.openjdk.org/jdk/pull/29835#issuecomment-3988867872

Reply via email to