PS The benefit of an intrinsic in a case like this is being to use a platform-optimized implementation, trading off native instruction, floating-point branch, and bitwise conversion costs.

-Joe

On 7/8/2021 4:26 AM, Joe Darcy wrote:
On 7/8/2021 3:50 AM, Andrew Haley wrote:
On Thu, 8 Jul 2021 09:43:35 GMT, Andrew Haley <a...@openjdk.org> wrote:

Moves between GPRs and FPRs are often slow. There's a 10-cycle latency on some AArch64, so we avoid it whenever we can. Mind you, we don't care about this patch because we always generate FABS from an intrinsic anyway.
For avoidance of doubt, that's the round-trip latency.

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

PR: https://git.openjdk.java.net/jdk/pull/4711


For coding this functionality in Java, the natural way to do this uses either an if statement or the bit-wise conversion, which usually implies GPRs to/from FPRs movement. I don't see a way to avoid both an if statement and bitwise conversion.

-Joe

Reply via email to