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

(CmpI/L(AndI/L reg1 reg2)) on x86 can be optimized

XMLWordPrintable

    • b22
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Currently, when a AND node is followed by a CMP node and the AND node operates on two registeres, a "and" and "test" instruction would be emitted. This can be optimized to use a single "test" instruction, the removed "and" means 2 bytes less have to be emitted. The Architecture Description file currently only handles the cases where the right operand of the And-Node is a constant, but not if both are a register.

      I have already opened a PR for this issue: https://github.com/openjdk/jdk/pull/13587
      Microbenchmarks result from that show an improvement from 0-29%.


            thartmann Tobias Hartmann
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: