From 3ab0b59aad23abac524bb6b8e4e4f7b149344d21 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 6 Oct 2010 05:35:22 +0000 Subject: add a class for _REV nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115748 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrArithmetic.td | 40 +++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td index 72021a40a1..d3013e4c8c 100644 --- a/lib/Target/X86/X86InstrArithmetic.td +++ b/lib/Target/X86/X86InstrArithmetic.td @@ -562,14 +562,22 @@ class ITy opcode, Format f, X86TypeInfo typeinfo, dag outs, dag ins, class BinOpRR opcode, string mnemonic, X86TypeInfo typeinfo, - SDNode opnode, Format format> - : ITy + : ITy; +class BinOpRR_Rev opcode, string mnemonic, X86TypeInfo typeinfo> + : ITy { + // The disassembler should know about this, but not the asmparser. + let isCodeGenOnly = 1; +} class BinOpRM opcode, string mnemonic, X86TypeInfo typeinfo, SDNode opnode> @@ -581,33 +589,27 @@ class BinOpRM opcode, string mnemonic, X86TypeInfo typeinfo, (opnode typeinfo.RegClass:$src1, (typeinfo.LoadNode addr:$src2)))]>; + + // Logical operators. let Defs = [EFLAGS] in { let Constraints = "$src1 = $dst" in { let isCommutable = 1 in { // X = AND Y, Z --> X = AND Z, Y -def AND8rr : BinOpRR<0x20, "and", Xi8 , X86and_flag, MRMDestReg>; -def AND16rr : BinOpRR<0x20, "and", Xi16, X86and_flag, MRMDestReg>; -def AND32rr : BinOpRR<0x20, "and", Xi32, X86and_flag, MRMDestReg>; -def AND64rr : BinOpRR<0x20, "and", Xi64, X86and_flag, MRMDestReg>; +def AND8rr : BinOpRR<0x20, "and", Xi8 , X86and_flag>; +def AND16rr : BinOpRR<0x20, "and", Xi16, X86and_flag>; +def AND32rr : BinOpRR<0x20, "and", Xi32, X86and_flag>; +def AND64rr : BinOpRR<0x20, "and", Xi64, X86and_flag>; } // isCommutable // AND instructions with the destination register in REG and the source register // in R/M. Included for the disassembler. -let isCodeGenOnly = 1 in { -def AND8rr_REV : I<0x22, MRMSrcReg, (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), - "and{b}\t{$src2, $dst|$dst, $src2}", []>; -def AND16rr_REV : I<0x23, MRMSrcReg, (outs GR16:$dst), - (ins GR16:$src1, GR16:$src2), - "and{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize; -def AND32rr_REV : I<0x23, MRMSrcReg, (outs GR32:$dst), - (ins GR32:$src1, GR32:$src2), - "and{l}\t{$src2, $dst|$dst, $src2}", []>; -def AND64rr_REV : RI<0x23, MRMSrcReg, (outs GR64:$dst), - (ins GR64:$src1, GR64:$src2), - "and{q}\t{$src2, $dst|$dst, $src2}", []>; -} + +def AND8rr_REV : BinOpRR_Rev<0x22, "and", Xi8>; +def AND16rr_REV : BinOpRR_Rev<0x22, "and", Xi16>; +def AND32rr_REV : BinOpRR_Rev<0x22, "and", Xi32>; +def AND64rr_REV : BinOpRR_Rev<0x22, "and", Xi64>; def AND8rm : BinOpRM<0x22, "and", Xi8 , X86and_flag>; def AND16rm : BinOpRM<0x22, "and", Xi16, X86and_flag>; -- cgit v1.2.3