From b90e7ec2dcddaae9e533a56f3f348a8b0c2c646c Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 25 Jan 2011 16:16:32 +0000 Subject: [PATCH] [AVX] Add TableGen classes for vector/subvector type constraints. This will be used to check patterns referencing a forthcoming INSERT_SUBVECTOR SDNode and will also be used to check EXTRACT_SUBVECTOR nodes. llvm-svn: 124191 --- include/llvm/Target/TargetSelectionDAG.td | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/llvm/Target/TargetSelectionDAG.td b/include/llvm/Target/TargetSelectionDAG.td index 37ebc12e5b2..7119e013a76 100644 --- a/include/llvm/Target/TargetSelectionDAG.td +++ b/include/llvm/Target/TargetSelectionDAG.td @@ -61,6 +61,13 @@ class SDTCisEltOfVec int OtherOpNum = OtherOp; } +/// SDTCisSubVecOfVec - This indicates that ThisOp is a vector type +/// with length less that of OtherOp, which is a vector type. +class SDTCisSubVecOfVec + : SDTypeConstraint { + int OtherOpNum = OtherOp; +} + //===----------------------------------------------------------------------===// // Selection DAG Type Profile definitions. // @@ -183,6 +190,13 @@ def SDTVecInsert : SDTypeProfile<1, 3, [ // vector insert SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>, SDTCisPtrTy<3> ]>; +def SDTSubVecExtract : SDTypeProfile<1, 1, [// subvector extract + SDTCisSubVecOfVec<0,1> +]>; +def SDTSubVecInsert : SDTypeProfile<1, 2, [ // subvector insert + SDTCisSubVecOfVec<2, 1>, SDTCisSameAs<0,1> +]>; + def SDTPrefetch : SDTypeProfile<0, 3, [ // prefetch SDTCisPtrTy<0>, SDTCisSameAs<1, 2>, SDTCisInt<1> ]>;