Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8280526

x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}

XMLWordPrintable

    • b07
    • x86

        While working on JDK-8279076 backport to 17u, I noticed that one tier1 test times out:

        $ CONF=linux-x86-server-fastdebug make run-test TEST=compiler/loopopts/superword/SumRedSqrt_Double.java TEST_VM_OPTS="-XX:UseSSE=0 -XX:UseAVX=0"

        After some investigation, I realized that the Matcher::match_rule_supported addition in JDK-8279076 is done to match SqrtD in x86.ad. x86_32.ad has a separate rule that works with UseSSE <= 1!

        instruct sqrtDPR_reg(regDPR dst, regDPR src) %{
          predicate (UseSSE<=1);
          match(Set dst (SqrtD src));
          format %{ "DSQRT $dst,$src" %}
          opcode(0xFA, 0xD9);
          ins_encode( Push_Reg_DPR(src),
                      OpcS, OpcP, Pop_Reg_DPR(dst) );
          ins_pipe( pipe_slow );
        %}

        Which means JDK-8279076 regressed x86_32 with -XX:UseSSE={0,1}, because now it would say to C2 that Op_SqrtD is not supported.

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: