mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Do not codegen 'xor bool, true' as 'not reg'. not reg inverts the upper bits
of the bytereg. This fixes yacr2, 300.twolf and probably others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5836082286
commit
c98279d371
@ -1585,17 +1585,20 @@ unsigned ISel::SelectExpr(SDOperand N) {
|
||||
|
||||
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op1)) {
|
||||
if (CN->isAllOnesValue() && Node->getOpcode() == ISD::XOR) {
|
||||
Opc = 0;
|
||||
switch (N.getValueType()) {
|
||||
default: assert(0 && "Cannot add this type!");
|
||||
case MVT::i1:
|
||||
case MVT::i1: break; // Not supported, don't invert upper bits!
|
||||
case MVT::i8: Opc = X86::NOT8r; break;
|
||||
case MVT::i16: Opc = X86::NOT16r; break;
|
||||
case MVT::i32: Opc = X86::NOT32r; break;
|
||||
}
|
||||
if (Opc) {
|
||||
Tmp1 = SelectExpr(Op0);
|
||||
BuildMI(BB, Opc, 1, Result).addReg(Tmp1);
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
|
||||
switch (N.getValueType()) {
|
||||
default: assert(0 && "Cannot xor this type!");
|
||||
|
Loading…
Reference in New Issue
Block a user