diff options
author | Roman Leshchinskiy <rl@cse.unsw.edu.au> | 2007-11-16 05:09:59 +0000 |
---|---|---|
committer | Roman Leshchinskiy <rl@cse.unsw.edu.au> | 2007-11-16 05:09:59 +0000 |
commit | fd399de26f49a14431a07ed4a1351f41781b80ec (patch) | |
tree | dd89fa4c59eb6b723e2f66bd2ccbedd959913871 /compiler/vectorise/VectUtils.hs | |
parent | 7a23b26cc7d6a7d0e375bb3ac53bb4947f21689e (diff) | |
download | haskell-fd399de26f49a14431a07ed4a1351f41781b80ec.tar.gz |
Add vectorisation built-ins
Diffstat (limited to 'compiler/vectorise/VectUtils.hs')
-rw-r--r-- | compiler/vectorise/VectUtils.hs | 7 |
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 |