From c3a767e9b0b8ec9bb943e287703eb4d40590727f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 5 Oct 2010 22:01:02 +0000 Subject: [PATCH] add a multiclass for cmov's, but don't start using it yet. llvm-svn: 115692 --- llvm/lib/Target/X86/X86InstrCMovSetCC.td | 41 +++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86InstrCMovSetCC.td b/llvm/lib/Target/X86/X86InstrCMovSetCC.td index 78b7507ef082..9853a0cd6117 100644 --- a/llvm/lib/Target/X86/X86InstrCMovSetCC.td +++ b/llvm/lib/Target/X86/X86InstrCMovSetCC.td @@ -12,7 +12,46 @@ // //===----------------------------------------------------------------------===// -// FIXME: Someone please sprinkle some defm's in here! + +// SetCC instructions. +multiclass CMOV opc, string Mnemonic, PatLeaf CondNode> { + let Uses = [EFLAGS], Predicates = [HasCMov], Constraints = "$src1 = $dst", + isCommutable = 1 in { + def rr16 : I, + TB, OpSize; + def rr32 : I, + TB; + def rr64 :RI, + TB; + } + + let Uses = [EFLAGS], Predicates = [HasCMov], Constraints = "$src1 = $dst"in { + def rm16 : I, TB, OpSize; + def rm32 : I, TB; + def rm64 :RI, TB; + } // Uses = [EFLAGS], Predicates = [HasCMov], Constraints = "$src1 = $dst" +} // end multiclass + +//defm CMOVBE : CMOV<0x46, "cmovbe", X86_COND_BE>; + let Constraints = "$src1 = $dst" in {