RFR: 8338694: x86_64 intrinsic for tanh using libm

Andrew Haley aph-open at littlepinkcloud.com
Tue Aug 27 18:09:18 UTC 2024


On 8/27/24 12:13, Jatin Bhateja wrote:
> Hi @vamsi-parasa ,  Kindly also add a JMH micro benchmark, I did a first
>   run and see around 4% performance drop with attached micro on Sapphire
> Rapids.
> [test.txt](https://github.com/user-attachments/files/16761142/test.txt)

If I had to guess, that's because there are no infinities and no NaNs
so HotSpot will perfectly predict .

Given that this "normal" execution is the expected use of tanh(), it
seems to me that this intrinsic won't help in the usual case, and may
make things worse.



More information about the core-libs-dev mailing list