RFR: 8285868: x86_64 intrinsics for floating point methods isNaN, isFinite and isInfinite [v8]

Srinivas Vamsi Parasa duke at openjdk.java.net
Mon May 23 04:57:02 UTC 2022


On Sat, 21 May 2022 15:42:34 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> > For 32bit, in the case of double, we see performance improvement using `vfpclasssd` instruction but **without** `vfpclassd`, we see **40% decrease** in performance for `isFinite()` compared to the original Java code. Below, is the code which implements the intrinsic using SSE.
> > Is it Ok to skip support for **non** `vfpclassd` for 32bit?
> 
> Yes, but add comment about that. Also for 32-bit you need to check SSE2 support which is required by `pshuflw`.

Thanks Vladimir! Will add a comment that the intrinsic doesn't give speedup without `vfpclasssd`. 
Yes, the check for `predicate(UseSSE>=2)` was added in the macro shown below.

instruct DoubleClassCheck_reg_reg_sse(rRegI dst, regD src, rRegI tmp, rRegI tmp1, rFlagsReg cr)
%{
  predicate(UseSSE>=2);
  match(Set dst (IsInfiniteD src));
  match(Set dst (IsNaND src));
  match(Set dst (IsFiniteD src));
  effect(TEMP tmp, TEMP tmp1, KILL cr);
  format %{ "double_class_check $dst, $src" %}
  ins_encode %{
    int opcode = this->ideal_Opcode();
    __ double_class_check_sse(opcode, $src$$XMMRegister, $dst$$Register, $tmp$$Register,
                $tmp1$$Register);
  %}
  ins_pipe(pipe_slow);
%}

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

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


More information about the hotspot-compiler-dev mailing list