[AVX] Add TableGen classes for vector/subvector type constraints.
authorDavid Greene <greened@obbligato.org>
Tue, 25 Jan 2011 16:16:32 +0000 (16:16 +0000)
committerDavid Greene <greened@obbligato.org>
Tue, 25 Jan 2011 16:16:32 +0000 (16:16 +0000)
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode and will also be used to check
EXTRACT_SUBVECTOR nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124191 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetSelectionDAG.td

index 37ebc12e5b2cffca97940202ab02271a1cccac9d..7119e013a766c32d6e5f58dc578baa2ff36690ba 100644 (file)
@@ -61,6 +61,13 @@ class SDTCisEltOfVec<int ThisOp, int OtherOp>
   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<int ThisOp, int OtherOp>
+  : SDTypeConstraint<ThisOp> {
+  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>
 ]>;