Add and-not (bic) patterns. Based heavily on patch by Brian Lucas!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2009-11-08 15:33:12 +00:00
parent 830fe7bc2d
commit f0b47b7f6d
7 changed files with 85 additions and 3 deletions

View File

@@ -462,7 +462,6 @@ def AND16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
(implicit SRW)]>;
}
let isCommutable = 1 in { // X = OR Y, Z == X = OR Z, Y
def OR8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
"bis.b\t{$src2, $dst}",
@@ -519,6 +518,37 @@ def OR16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
(i16 (load addr:$src))), addr:$dst)]>;
}
// bic does not modify condition codes
def BIC8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
"bic.b\t{$src2, $dst}",
[(set GR8:$dst, (and GR8:$src1, (not GR8:$src2)))]>;
def BIC16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
"bic.w\t{$src2, $dst}",
[(set GR16:$dst, (and GR16:$src1, (not GR16:$src2)))]>;
def BIC8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
"bic.b\t{$src2, $dst}",
[(set GR8:$dst, (and GR8:$src1, (not (i8 (load addr:$src2)))))]>;
def BIC16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
"bic.w\t{$src2, $dst}",
[(set GR16:$dst, (and GR16:$src1, (not (i16 (load addr:$src2)))))]>;
let isTwoAddress = 0 in {
def BIC8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
"bic.b\t{$src, $dst}",
[(store (and (load addr:$dst), (not GR8:$src)), addr:$dst)]>;
def BIC16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
"bic.w\t{$src, $dst}",
[(store (and (load addr:$dst), (not GR16:$src)), addr:$dst)]>;
def BIC8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
"bic.b\t{$src, $dst}",
[(store (and (load addr:$dst), (not (i8 (load addr:$src)))), addr:$dst)]>;
def BIC16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
"bic.w\t{$src, $dst}",
[(store (and (load addr:$dst), (not (i16 (load addr:$src)))), addr:$dst)]>;
}
let isCommutable = 1 in { // X = XOR Y, Z == X = XOR Z, Y
def XOR8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
"xor.b\t{$src2, $dst}",