The Test instruction applied to the rCX register followed by a Jump if Zero
with an 8-bit displacement can be replaced by a single JCXZ/JECXZ/JRCXZ
instruction with no loss of performance (1 cycle + 1 cycle verses 2 cycles on
K8 processors) and a one or two byte decrease in I-cache use per instance.

Replacing TEST rCX/JZ sequences with the JrCXZ insn would be a good first step;
preferentially using the rCX register in order to maximize JrCXZ replacements
would be better.


-- 
           Summary: TESTW{W,L,Q} rCX + JZ/JE should be replaced by
                    J{,E,R}CXZ when possible
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nmiell at comcast dot net
GCC target triplet: i?86-*-*, x86_64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29793

Reply via email to