aboutsummaryrefslogtreecommitdiffstats
path: root/test/TableGen
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-04-23 21:25:15 +0000
committerDavid Greene <greened@obbligato.org>2009-04-23 21:25:15 +0000
commite8cf21e8e3db64dd49777d6bf6c867d47e9f5407 (patch)
tree5dc8b12e071de2abba651968b6bc3ed1b955fb2d /test/TableGen
parentaa809fbde12dda27943bafb631fbad22130814e2 (diff)
downloadexternal_llvm-e8cf21e8e3db64dd49777d6bf6c867d47e9f5407.zip
external_llvm-e8cf21e8e3db64dd49777d6bf6c867d47e9f5407.tar.gz
external_llvm-e8cf21e8e3db64dd49777d6bf6c867d47e9f5407.tar.bz2
Make BinOps typed and require a type specifier for !nameconcat. This
allows binops to be used in typed contexts such as when passing arguments to classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/nameconcat.td20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/TableGen/nameconcat.td b/test/TableGen/nameconcat.td
index 8dbc4b8..fc865f9 100644
--- a/test/TableGen/nameconcat.td
+++ b/test/TableGen/nameconcat.td
@@ -1,4 +1,4 @@
-// RUN: tblgen %s | grep {add_ps} | count 2
+// RUN: tblgen %s | grep {add_ps} | count 3
class ValueType<int size, int value> {
int Size = size;
@@ -66,11 +66,25 @@ def int_x86_sse2_add_pd : Intrinsic<"addpd">;
multiclass arith<bits<8> opcode, string asmstr, string Intr> {
def PS : Inst<opcode, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
!strconcat(asmstr, "\t$dst, $src1, $src2"),
- [(set VR128:$dst, (!nameconcat(Intr, "_ps") VR128:$src1, VR128:$src2))]>;
+ [(set VR128:$dst, (!nameconcat<Intrinsic>(Intr, "_ps") VR128:$src1, VR128:$src2))]>;
def PD : Inst<opcode, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
!strconcat(asmstr, "\t$dst, $src1, $src2"),
- [(set VR128:$dst, (!nameconcat(Intr, "_pd") VR128:$src1, VR128:$src2))]>;
+ [(set VR128:$dst, (!nameconcat<Intrinsic>(Intr, "_pd") VR128:$src1, VR128:$src2))]>;
}
defm ADD : arith<0x58, "add", "int_x86_sse2_add">;
+
+class IntInst<bits<8> opcode, string asmstr, Intrinsic Intr> :
+ Inst<opcode,(outs VR128:$dst), (ins VR128:$src1, VR128:$src2),
+ !strconcat(asmstr, "\t$dst, $src1, $src2"),
+ [(set VR128:$dst, (Intr VR128:$src1, VR128:$src2))]>;
+
+
+multiclass arith_int<bits<8> opcode, string asmstr, string Intr> {
+ def PS_Int : IntInst<opcode, asmstr, !nameconcat<Intrinsic>(Intr, "_ps")>;
+
+ def PD_Int : IntInst<opcode, asmstr, !nameconcat<Intrinsic>(Intr, "_pd")>;
+}
+
+defm ADD : arith_int<0x58, "add", "int_x86_sse2_add">;