X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fvectorise%2FVectCore.hs;h=cdae4dd9968a17ce6054ede5096828d961402276;hb=3a90968fac18bbf931420afff6ef866614ecdd7f;hp=1ccc3813ce168eaa6f0749dd1a050856a6e76fb5;hpb=76cec9c6231e5e73c5dd17e5c7111a79ffde0b03;p=ghc-hetmet.git diff --git a/compiler/vectorise/VectCore.hs b/compiler/vectorise/VectCore.hs index 1ccc381..cdae4dd 100644 --- a/compiler/vectorise/VectCore.hs +++ b/compiler/vectorise/VectCore.hs @@ -4,10 +4,13 @@ module VectCore ( vectorised, lifted, mapVect, + vVarType, + vNonRec, vRec, vVar, vType, vNote, vLet, - vLams, vLamsWithoutLC, vVarApps + vLams, vLamsWithoutLC, vVarApps, + vCaseDEFAULT ) where #include "HsVersions.h" @@ -33,6 +36,9 @@ mapVect f (x,y) = (f x, f y) zipWithVect :: (a -> b -> c) -> Vect a -> Vect b -> Vect c zipWithVect f (x1,y1) (x2,y2) = (f x1 x2, f y1 y2) +vVarType :: VVar -> Type +vVarType = varType . vectorised + vVar :: VVar -> VExpr vVar = mapVect Var @@ -69,4 +75,10 @@ vVarApps lc (ve, le) vvs = (ve `mkVarApps` vs, le `mkVarApps` (lc : ls)) where (vs,ls) = unzip vvs +vCaseDEFAULT :: VExpr -> VVar -> Type -> Type -> VExpr -> VExpr +vCaseDEFAULT (vscrut, lscrut) (vbndr, lbndr) vty lty (vbody, lbody) + = (Case vscrut vbndr vty (mkDEFAULT vbody), + Case lscrut lbndr lty (mkDEFAULT lbody)) + where + mkDEFAULT e = [(DEFAULT, [], e)]