summaryrefslogtreecommitdiff
path: root/compiler/vectorise/VectUtils.hs
diff options
context:
space:
mode:
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>2007-11-16 05:09:59 +0000
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>2007-11-16 05:09:59 +0000
commitfd399de26f49a14431a07ed4a1351f41781b80ec (patch)
treedd89fa4c59eb6b723e2f66bd2ccbedd959913871 /compiler/vectorise/VectUtils.hs
parent7a23b26cc7d6a7d0e375bb3ac53bb4947f21689e (diff)
downloadhaskell-fd399de26f49a14431a07ed4a1351f41781b80ec.tar.gz
Add vectorisation built-ins
Diffstat (limited to 'compiler/vectorise/VectUtils.hs')
-rw-r--r--compiler/vectorise/VectUtils.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/vectorise/VectUtils.hs b/compiler/vectorise/VectUtils.hs
index 83b482a669..ebb2718f75 100644
--- a/compiler/vectorise/VectUtils.hs
+++ b/compiler/vectorise/VectUtils.hs
@@ -16,7 +16,7 @@ module VectUtils (
parrayReprTyCon, parrayReprDataCon, mkVScrut,
prDFunOfTyCon,
paDictArgType, paDictOfType, paDFunType,
- paMethod, mkPR, lengthPA, replicatePA, emptyPA, liftPA,
+ paMethod, mkPR, lengthPA, replicatePA, emptyPA, packPA, liftPA,
polyAbstract, polyApply, polyVApply,
hoistBinding, hoistExpr, hoistPolyVExpr, takeHoisted,
buildClosure, buildClosures,
@@ -221,6 +221,7 @@ type PAMethod = (Builtins -> Var, String)
pa_length = (lengthPAVar, "lengthPA")
pa_replicate = (replicatePAVar, "replicatePA")
pa_empty = (emptyPAVar, "emptyPA")
+pa_pack = (packPAVar, "packPA")
paMethod :: PAMethod -> Type -> VM CoreExpr
paMethod (method, name) ty
@@ -253,6 +254,10 @@ replicatePA len x = liftM (`mkApps` [len,x])
emptyPA :: Type -> VM CoreExpr
emptyPA = paMethod pa_empty
+packPA :: Type -> CoreExpr -> CoreExpr -> CoreExpr -> VM CoreExpr
+packPA ty xs len sel = liftM (`mkApps` [len, sel])
+ (paMethod pa_pack ty)
+
liftPA :: CoreExpr -> VM CoreExpr
liftPA x
= do