llvm.org GIT mirror llvm / fd56d75
Update Test for Multidefs Update the MultiPat.td test to create some defs via multidefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141235 91177308-0d34-0410-b5e6-96231b3b80d8 David Greene 7 years ago
1 changed file(s) with 16 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
8484 def int_x86_sse2_add_pd : Intrinsic<"addpd">;
8585 def INTRINSIC : Intrinsic<"Dummy">;
8686 def bitconvert;
87 def add;
8788
88 class MakePat patterns> : Pat;
89 class MakePatImpl patterns> : Pat;
90 class MakePat patterns,
91 string suffix,
92 string intr> : MakePatImpl
93 !foreach(Decls.operand, Decls.pattern,
94 !subst(INTRINSIC, !cast(!subst("SUFFIX", suffix, intr)),
95 !subst(REGCLASS, VR128,
96 !subst(MNEMONIC, set, Decls.operand)))))>;
8997
9098 class Base opcode, dag opnds, dag iopnds, string asmstr, Intrinsic intr,
9199 list> patterns>
94102 !foreach(Decls.operand, Decls.pattern,
95103 !subst(INTRINSIC, intr,
96104 !subst(REGCLASS, VR128,
97 !subst(MNEMONIC, set, Decls.operand)))))>,
98 MakePat
99 !foreach(Decls.operand, Decls.pattern,
100 !subst(INTRINSIC, intr,
101 !subst(REGCLASS, VR128,
102 !subst(MNEMONIC, set, Decls.operand)))))>;
105 !subst(MNEMONIC, set, Decls.operand)))))>;
103106
104107 multiclass arith opcode, string asmstr, string intr, list> patterns> {
105108 def PS : Base
107110
108111 def PD : Base
109112 !strconcat(asmstr, "\t$dst, $src1, $src2"), !cast(!subst("SUFFIX", "_pd", intr)), patterns>;
113
114 multidef pats, 1> : MakePat;
115 multidef pats, 1> : MakePat;
110116 }
111117
112118 defm ADD : arith<0x58, "add", "int_x86_sse2_addSUFFIX",
113119 // rr Patterns
114120 [[(set REGCLASS:$dst, (INTRINSIC REGCLASS:$src1, REGCLASS:$src2))],
115121 [(set REGCLASS:$dst, (bitconvert (INTRINSIC REGCLASS:$src1, REGCLASS:$src2))),
116 (MNEMONIC REGCLASS:$dst, REGCLASS:$src)]]>;
122 (MNEMONIC REGCLASS:$dst, REGCLASS:$src)],
123 [(set REGCLASS:$dst, (add (INTRINSIC REGCLASS:$src1, REGCLASS:$src2))),
124 (MNEMONIC (add REGCLASS:$dst, REGCLASS:$src))]]>;
117125
118126 // CHECK: [(set VR128:$dst, (int_x86_sse2_add_pd VR128:$src1, VR128:$src2))]
119127 // CHECK: [(set VR128:$dst, (int_x86_sse2_add_ps VR128:$src1, VR128:$src2))]