X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fvectorise%2FVectUtils.hs;h=e5084241d61784106054345b76a82b76d47ebcc4;hb=cfccfa67393fcf8cb43aaa465d421b67c7117580;hp=caa4f4055d102f5484b6c448457f3615bd9f3043;hpb=a139addf4890fc2167949680ead07ab809a9d98b;p=ghc-hetmet.git diff --git a/compiler/vectorise/VectUtils.hs b/compiler/vectorise/VectUtils.hs index caa4f40..e508424 100644 --- a/compiler/vectorise/VectUtils.hs +++ b/compiler/vectorise/VectUtils.hs @@ -11,7 +11,7 @@ module VectUtils ( pdataReprTyCon, pdataReprDataCon, mkVScrut, prDictOfType, prDFunOfTyCon, paDictArgType, paDictOfType, paDFunType, - paMethod, wrapPR, replicatePD, emptyPD, packPD, + paMethod, wrapPR, replicatePD, emptyPD, packPD, packByTagPD, combinePD, liftPD, zipScalars, scalarClosure, @@ -98,7 +98,7 @@ mkBuiltinTyConApps get_tc tys ty mk tc ty1 ty2 = mkTyConApp tc [ty1,ty2] voidType :: VM Type -voidType = mkBuiltinTyConApp voidTyCon [] +voidType = mkBuiltinTyConApp VectMonad.voidTyCon [] mkWrapType :: Type -> VM Type mkWrapType ty = mkBuiltinTyConApp wrapTyCon [ty] @@ -241,9 +241,9 @@ prDictOfTyApp ty_fn ty_args | Just ty_fn' <- coreView ty_fn = prDictOfTyApp ty_fn' ty_args prDictOfTyApp (TyConApp tc _) ty_args = do - dfun <- prDFunOfTyCon tc + dfun <- liftM Var $ maybeV (lookupTyConPR tc) prDFunApply dfun ty_args -prDictOfTyApp ty _ = noV +prDictOfTyApp _ _ = noV prDFunApply :: CoreExpr -> [Type] -> VM CoreExpr prDFunApply dfun tys @@ -269,6 +269,12 @@ packPD :: Type -> CoreExpr -> CoreExpr -> CoreExpr -> VM CoreExpr packPD ty xs len sel = liftM (`mkApps` [xs, len, sel]) (paMethod packPDVar "packPD" ty) +packByTagPD :: Type -> CoreExpr -> CoreExpr -> CoreExpr -> CoreExpr + -> VM CoreExpr +packByTagPD ty xs len tags t + = liftM (`mkApps` [xs, len, tags, t]) + (paMethod packByTagPDVar "packByTagPD" ty) + combinePD :: Type -> CoreExpr -> CoreExpr -> [CoreExpr] -> VM CoreExpr combinePD ty len sel xs