From 021a0dd265ff34c1e292813c06185eff1d6b5c1c Mon Sep 17 00:00:00 2001 From: Manuel M T Chakravarty Date: Wed, 7 Dec 2011 22:40:14 +1100 Subject: Add new primtypes 'ArrayArray#' and 'MutableArrayArray#' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The primitive array types, such as 'ByteArray#', have kind #, but are represented by pointers. They are boxed, but unpointed types (i.e., they cannot be 'undefined'). The two categories of array types —[Mutable]Array# and [Mutable]ByteArray#— are containers for unboxed (and unpointed) as well as for boxed and pointed types. So far, we lacked support for containers for boxed, unpointed types (i.e., containers for the primitive arrays themselves). This is what the new primtypes provide. Containers for boxed, unpointed types are crucial for the efficient implementation of scattered nested arrays, which are central to the new DPH backend library dph-lifted-vseg. Without such containers, we cannot eliminate all unboxing from the inner loops of traversals processing scattered nested arrays. --- utils/genprimopcode/Main.hs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'utils') diff --git a/utils/genprimopcode/Main.hs b/utils/genprimopcode/Main.hs index da15c2532c..7ac32f6124 100644 --- a/utils/genprimopcode/Main.hs +++ b/utils/genprimopcode/Main.hs @@ -648,21 +648,22 @@ ppType (TyApp "ForeignObj#" []) = "foreignObjPrimTy" ppType (TyApp "BCO#" []) = "bcoPrimTy" ppType (TyApp "()" []) = "unitTy" -- unitTy is TysWiredIn's name for () -ppType (TyVar "a") = "alphaTy" -ppType (TyVar "b") = "betaTy" -ppType (TyVar "c") = "gammaTy" -ppType (TyVar "s") = "deltaTy" -ppType (TyVar "o") = "openAlphaTy" -ppType (TyApp "State#" [x]) = "mkStatePrimTy " ++ ppType x -ppType (TyApp "MutVar#" [x,y]) = "mkMutVarPrimTy " ++ ppType x - ++ " " ++ ppType y -ppType (TyApp "MutableArray#" [x,y]) = "mkMutableArrayPrimTy " ++ ppType x - ++ " " ++ ppType y - -ppType (TyApp "MutableByteArray#" [x]) = "mkMutableByteArrayPrimTy " - ++ ppType x - -ppType (TyApp "Array#" [x]) = "mkArrayPrimTy " ++ ppType x +ppType (TyVar "a") = "alphaTy" +ppType (TyVar "b") = "betaTy" +ppType (TyVar "c") = "gammaTy" +ppType (TyVar "s") = "deltaTy" +ppType (TyVar "o") = "openAlphaTy" + +ppType (TyApp "State#" [x]) = "mkStatePrimTy " ++ ppType x +ppType (TyApp "MutVar#" [x,y]) = "mkMutVarPrimTy " ++ ppType x + ++ " " ++ ppType y +ppType (TyApp "MutableArray#" [x,y]) = "mkMutableArrayPrimTy " ++ ppType x + ++ " " ++ ppType y +ppType (TyApp "MutableArrayArray#" [x]) = "mkMutableArrayArrayPrimTy " ++ ppType x +ppType (TyApp "MutableByteArray#" [x]) = "mkMutableByteArrayPrimTy " + ++ ppType x +ppType (TyApp "Array#" [x]) = "mkArrayPrimTy " ++ ppType x +ppType (TyApp "ArrayArray#" []) = "mkArrayArrayPrimTy" ppType (TyApp "Weak#" [x]) = "mkWeakPrimTy " ++ ppType x -- cgit v1.2.1