llvm.org GIT mirror llvm / b484213
add a multiclass for cmov's, but don't start using it yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115692 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
1 changed file(s) with 40 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 // FIXME: Someone please sprinkle some defm's in here!
14
15 // SetCC instructions.
16 multiclass CMOV opc, string Mnemonic, PatLeaf CondNode> {
17 let Uses = [EFLAGS], Predicates = [HasCMov], Constraints = "$src1 = $dst",
18 isCommutable = 1 in {
19 def rr16 : I
20 !strconcat(Mnemonic, "{w}\t{$src2, $dst|$dst, $src2}"),
21 [(set GR16:$dst,
22 (X86cmov GR16:$src1, GR16:$src2, CondNode, EFLAGS))]>,
23 TB, OpSize;
24 def rr32 : I
25 !strconcat(Mnemonic, "{l}\t{$src2, $dst|$dst, $src2}"),
26 [(set GR32:$dst,
27 (X86cmov GR32:$src1, GR32:$src2, CondNode, EFLAGS))]>,
28 TB;
29 def rr64 :RI
30 !strconcat(Mnemonic, "{q}\t{$src2, $dst|$dst, $src2}"),
31 [(set GR64:$dst,
32 (X86cmov GR64:$src1, GR64:$src2, CondNode, EFLAGS))]>,
33 TB;
34 }
35
36 let Uses = [EFLAGS], Predicates = [HasCMov], Constraints = "$src1 = $dst"in {
37 def rm16 : I
38 !strconcat(Mnemonic, "{w}\t{$src2, $dst|$dst, $src2}"),
39 [(set GR16:$dst, (X86cmov GR16:$src1, (loadi16 addr:$src2),
40 CondNode, EFLAGS))]>, TB, OpSize;
41 def rm32 : I
42 !strconcat(Mnemonic, "{l}\t{$src2, $dst|$dst, $src2}"),
43 [(set GR32:$dst, (X86cmov GR32:$src1, (loadi32 addr:$src2),
44 CondNode, EFLAGS))]>, TB;
45 def rm64 :RI
46 !strconcat(Mnemonic, "{q}\t{$src2, $dst|$dst, $src2}"),
47 [(set GR64:$dst, (X86cmov GR64:$src1, (loadi64 addr:$src2),
48 CondNode, EFLAGS))]>, TB;
49 } // Uses = [EFLAGS], Predicates = [HasCMov], Constraints = "$src1 = $dst"
50 } // end multiclass
51
52 //defm CMOVBE : CMOV<0x46, "cmovbe", X86_COND_BE>;
53
1554
1655 let Constraints = "$src1 = $dst" in {
1756