From: David Greene Date: Wed, 5 Oct 2011 22:42:48 +0000 (+0000) Subject: Update Test for Multidefs X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fd56d75396fd945d5cedb634d34fb3c3f739b3e8;p=oota-llvm.git 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 --- diff --git a/test/TableGen/MultiPat.td b/test/TableGen/MultiPat.td index 54c13c1975b..ed14438ca61 100644 --- a/test/TableGen/MultiPat.td +++ b/test/TableGen/MultiPat.td @@ -85,8 +85,16 @@ def int_x86_sse2_add_ps : Intrinsic<"addps">; def int_x86_sse2_add_pd : Intrinsic<"addpd">; def INTRINSIC : Intrinsic<"Dummy">; def bitconvert; +def add; -class MakePat patterns> : Pat; +class MakePatImpl patterns> : Pat; +class MakePat patterns, + string suffix, + string intr> : MakePatImpl(!subst("SUFFIX", suffix, intr)), + !subst(REGCLASS, VR128, + !subst(MNEMONIC, set, Decls.operand)))))>; class Base opcode, dag opnds, dag iopnds, string asmstr, Intrinsic intr, list> patterns> @@ -95,12 +103,7 @@ class Base opcode, dag opnds, dag iopnds, string asmstr, Intrinsic intr, !foreach(Decls.operand, Decls.pattern, !subst(INTRINSIC, intr, !subst(REGCLASS, VR128, - !subst(MNEMONIC, set, Decls.operand)))))>, - MakePat; + !subst(MNEMONIC, set, Decls.operand)))))>; multiclass arith opcode, string asmstr, string intr, list> patterns> { def PS : Base opcode, string asmstr, string intr, list> pat def PD : Base(!subst("SUFFIX", "_pd", intr)), patterns>; + + multidef pats, 1> : MakePat; + multidef pats, 1> : MakePat; } defm ADD : arith<0x58, "add", "int_x86_sse2_addSUFFIX", // rr Patterns [[(set REGCLASS:$dst, (INTRINSIC REGCLASS:$src1, REGCLASS:$src2))], [(set REGCLASS:$dst, (bitconvert (INTRINSIC REGCLASS:$src1, REGCLASS:$src2))), - (MNEMONIC REGCLASS:$dst, REGCLASS:$src)]]>; + (MNEMONIC REGCLASS:$dst, REGCLASS:$src)], + [(set REGCLASS:$dst, (add (INTRINSIC REGCLASS:$src1, REGCLASS:$src2))), + (MNEMONIC (add REGCLASS:$dst, REGCLASS:$src))]]>; // CHECK: [(set VR128:$dst, (int_x86_sse2_add_pd VR128:$src1, VR128:$src2))] // CHECK: [(set VR128:$dst, (int_x86_sse2_add_ps VR128:$src1, VR128:$src2))]