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

Optimize (masked) byte memory comparisons on x86

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b16
    • CPU:
      x86

      Backports

        Description

        We found this during Shenandoah performance work. In GC barriers fastpath, we have the shape like (Set cr (CmpI (AndI (LoadUB op1) op2) opZ)), which compiles down to:

         mov $op2, %r1
         andb ($op1), %r1
         test %r1, %r1

        ...while it can be compiled to just:

         testb ($op1), $op2

        ...thus saving the %r1.

        G1 SATB checks have similar shape, but without the mask, and they waste the register in the same way.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shade Aleksey Shipilev
                  Reporter:
                  shade Aleksey Shipilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: