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

Optimize (masked) byte memory comparisons on x86

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 11
    • 11
    • hotspot
    • b16
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: