llvm-6502/lib
Chris Lattner ac011bce9e lower "X = seteq Y, Z" to '(shr (ctlz (xor Y, Z)), 5)' instead of
'(shr (ctlz (sub Y, Z)), 5)'.

The use of xor better exposes the operation to bit-twiddling logic in the
dag combiner.  For example, this:

typedef struct {
  unsigned prefix : 4;
  unsigned code : 4;
  unsigned unsigned_p : 4;
} tree_common;

int foo(tree_common *a, tree_common *b) {
  return a->code == b->code;
}

Now compiles to:

_foo:
        lwz r2, 0(r4)
        lwz r3, 0(r3)
        xor r2, r3, r2
        rlwinm r2, r2, 28, 28, 31
        cntlzw r2, r2
        srwi r3, r2, 5
        blr

instead of:

_foo:
        lbz r2, 3(r4)
        lbz r3, 3(r3)
        srwi r2, r2, 4
        srwi r3, r3, 4
        subf r2, r2, r3
        cntlzw r2, r2
        srwi r3, r2, 5
        blr

saving a cycle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31725 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 05:28:08 +00:00
..
Analysis A shim over other AA impls to catch incorrect uses 2006-11-14 05:21:04 +00:00
Archive For PR797: 2006-08-25 19:54:53 +00:00
AsmParser Initialize some pointers to quiet the compiler (when doing build_gcc 2006-11-12 11:10:39 +00:00
Bytecode Discard code that supported old bytecode formats. This makes the Bytecode 2006-11-14 04:47:22 +00:00
CodeGen Matches MachineInstr changes. 2006-11-13 23:36:35 +00:00
Debugger For PR786: 2006-11-02 20:25:50 +00:00
ExecutionEngine if lazy compilation is disabled, print an error message and abort if 2006-11-09 19:32:13 +00:00
Linker Remvoe a do-nothing else block. 2006-11-11 20:27:49 +00:00
Support Remove redundant <cmath>. 2006-11-08 19:16:44 +00:00
System Unbreak VC++ build. 2006-11-05 19:31:28 +00:00
Target lower "X = seteq Y, Z" to '(shr (ctlz (xor Y, Z)), 5)' instead of 2006-11-14 05:28:08 +00:00
Transforms Fix InstCombine/2006-11-10-ashr-miscompile.ll a miscompilation introduced 2006-11-10 23:38:52 +00:00
VMCore Implement removeDeadPasses(). 2006-11-14 03:05:08 +00:00
Makefile Make some changes suggested by Chris: 2006-05-17 22:55:35 +00:00