From 78266110bf5e2b1b7406c81940d8c0b08a6b2e3f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 7 Oct 2010 00:01:39 +0000 Subject: [PATCH] add the pattern operator to match to X86TypeInfo, use this to convert AND64ri32 to use BinOpRI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115878 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrArithmetic.td | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td index d15910f7e3e..c98f98f6fc1 100644 --- a/lib/Target/X86/X86InstrArithmetic.td +++ b/lib/Target/X86/X86InstrArithmetic.td @@ -502,6 +502,7 @@ let CodeSize = 2 in { class X86TypeInfo { /// VT - This is the value type itself. ValueType VT = vt; @@ -534,6 +535,10 @@ class X86TypeInfo; + imm, 0, 0, 0>; def Xi16 : X86TypeInfo; + imm, 1, 1, 0>; def Xi32 : X86TypeInfo; + imm, 1, 0, 0>; def Xi64 : X86TypeInfo; + i64immSExt32, 1, 0, 1>; /// ITy - This instruction base class takes the type info for the instruction. /// Using this, it: @@ -612,7 +617,7 @@ class BinOpRI opcode, string mnemonic, X86TypeInfo typeinfo, (ins typeinfo.RegClass:$src1, typeinfo.ImmOperand:$src2), mnemonic, "{$src2, $dst|$dst, $src2}", [(set typeinfo.RegClass:$dst, EFLAGS, - (opnode typeinfo.RegClass:$src1, imm:$src2))]> { + (opnode typeinfo.RegClass:$src1, typeinfo.ImmOperator:$src2))]> { let ImmT = typeinfo.ImmEncoding; } @@ -646,12 +651,7 @@ def AND64rm : BinOpRM<0x22, "and", Xi64, X86and_flag>; def AND8ri : BinOpRI<0x80, "and", Xi8 , X86and_flag, MRM4r>; def AND16ri : BinOpRI<0x80, "and", Xi16, X86and_flag, MRM4r>; def AND32ri : BinOpRI<0x80, "and", Xi32, X86and_flag, MRM4r>; - -def AND64ri32 : RIi32<0x81, MRM4r, - (outs GR64:$dst), (ins GR64:$src1, i64i32imm:$src2), - "and{q}\t{$src2, $dst|$dst, $src2}", - [(set GR64:$dst, EFLAGS, - (X86and_flag GR64:$src1, i64immSExt32:$src2))]>; +def AND64ri32: BinOpRI<0x80, "and", Xi64, X86and_flag, MRM4r>; def AND16ri8 : Ii8<0x83, MRM4r, (outs GR16:$dst), (ins GR16:$src1, i16i8imm:$src2), -- 2.34.1