diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-12-07 22:40:14 +1100 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-12-07 22:59:14 +1100 |
commit | 021a0dd265ff34c1e292813c06185eff1d6b5c1c (patch) | |
tree | b7def5ebb7b8ce7f7637710e34c8034933510429 /utils/genprimopcode/Main.hs | |
parent | 782d22033417e9ba71ea3322d6c97ca25dcf2745 (diff) | |
download | haskell-021a0dd265ff34c1e292813c06185eff1d6b5c1c.tar.gz |
Add new primtypes 'ArrayArray#' and 'MutableArrayArray#'
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.
Diffstat (limited to 'utils/genprimopcode/Main.hs')
-rw-r--r-- | utils/genprimopcode/Main.hs | 31 |
1 files changed, 16 insertions, 15 deletions
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 |