diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-04-13 03:47:03 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-04-13 03:47:03 +0000 |
commit | 483f22d8173be97b6e5f337a46b2bff927682d77 (patch) | |
tree | b31cea66a4e3c639457351e6026b01d8831144d8 /lib/Target/Alpha/AlphaISelPattern.cpp | |
parent | ffe284c65137ac1d8e4421550bdc9979ed80e9ee (diff) |
added all flavors of zap for anding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaISelPattern.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaISelPattern.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp index 9b07ff77a8..fbd7bb1911 100644 --- a/lib/Target/Alpha/AlphaISelPattern.cpp +++ b/lib/Target/Alpha/AlphaISelPattern.cpp @@ -1692,6 +1692,26 @@ unsigned ISel::SelectExpr(SDOperand N) { } //Fall through case ISD::AND: + //handle zap + if (opcode == ISD::AND && N.getOperand(1).getOpcode() == ISD::Constant) + { + uint64_t k = cast<ConstantSDNode>(N.getOperand(1))->getValue(); + unsigned int build = 0; + for(int i = 0; i < 8; ++i) + { + if (k & 0xFF == 0xFF) + build |= 1 << i; + else if (k & 0xFF != 0) + { build = 0; break; } + k >>= 8; + } + if (build) + { + Tmp1 = SelectExpr(N.getOperand(0)); + BuildMI(BB, Alpha::ZAPNOTi, 2, Result).addReg(Tmp1).addImm(build); + return Result; + } + } case ISD::OR: //Check operand(0) == Not if (N.getOperand(0).getOpcode() == ISD::XOR && |