[vectorIntrinsics] RFR: 8261108: Add cast nodes from integer types to float types implementation for Arm SVE [v3]

Xiaohong Gong xgong at openjdk.java.net
Mon Feb 22 07:00:50 UTC 2021


On Sat, 20 Feb 2021 09:11:22 GMT, Wang Huang <whuang at openjdk.org> wrote:

>> Add the backend codegen for nodes like castb2f / castb2d / casts2f / casts2d / casti2f / casti2d / castl2f / castl2d.
>> 
>> * add `sve_scvtf`  ( and `sve_ucvtf`) encoding
>> * add mock for these instructions
>> * add `VECTOR_CAST_I2F_EXTEND[N]` and `VECTOR_CAST_I2F`
>> 
>> Thank you for your review.
>
> Wang Huang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add comments of encode function

src/hotspot/cpu/aarch64/aarch64_sve.ad line 2757:

> 2755:     __ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D);
> 2756:     __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0);
> 2757:     __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg));

This looks an issue to me. From the encoding, the `"__ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D);"` can directly converts 64-bits to single-precision. Why do you need the followed `sve_uzp1` instruction? I guess you want convert "long" to "double" and then to "float" ? If so, the first `scvtf` instruction should be `"__ sve_scvtf(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src$$reg), __ D);"`, and then encoding an `fcvt` which converts `"double"` to `"float"`. Please correct me if I'm wrong. Thanks!

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

PR: https://git.openjdk.java.net/panama-vector/pull/37


More information about the panama-dev mailing list