diff options
author | David Greene <greened@obbligato.org> | 2009-04-23 21:25:15 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2009-04-23 21:25:15 +0000 |
commit | 64ad38d16fbe55ca38d4eca2d3279d6bf45c9822 (patch) | |
tree | 5dc8b12e071de2abba651968b6bc3ed1b955fb2d /test/TableGen/nameconcat.td | |
parent | 1a0de0ea46e8e5b6d256aa6ecf42625201179430 (diff) | |
download | external_llvm-64ad38d16fbe55ca38d4eca2d3279d6bf45c9822.zip external_llvm-64ad38d16fbe55ca38d4eca2d3279d6bf45c9822.tar.gz external_llvm-64ad38d16fbe55ca38d4eca2d3279d6bf45c9822.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/nameconcat.td')
-rw-r--r-- | test/TableGen/nameconcat.td | 20 |
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">; |