Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
57bb5a4f
Commit
57bb5a4f
authored
Dec 15, 2007
by
rl@cse.unsw.edu.au
Browse files
Use (UArr Int) instead of PArray_Int# in vectorisation
parent
2509cf09
Changes
3
Hide whitespace changes
Inline
Side-by-side
compiler/vectorise/VectBuiltIn.hs
View file @
57bb5a4f
...
...
@@ -6,7 +6,8 @@
-- for details
module
VectBuiltIn
(
Builtins
(
..
),
sumTyCon
,
prodTyCon
,
combinePAVar
,
Builtins
(
..
),
sumTyCon
,
prodTyCon
,
uarrTy
,
intPrimArrayTy
,
combinePAVar
,
initBuiltins
,
initBuiltinVars
,
initBuiltinTyCons
,
initBuiltinDataCons
,
initBuiltinPAs
,
initBuiltinPRs
,
initBuiltinBoxedTyCons
,
...
...
@@ -29,11 +30,11 @@ import NameEnv
import
OccName
import
TypeRep
(
funTyCon
)
import
Type
(
Type
)
import
Type
(
Type
,
mkTyConApp
)
import
TysPrim
import
TysWiredIn
(
unitTyCon
,
unitDataCon
,
tupleTyCon
,
intTyCon
,
intTyConName
,
intTyCon
,
intTyConName
,
intTy
,
doubleTyCon
,
doubleTyConName
,
boolTyCon
,
boolTyConName
,
trueDataCon
,
falseDataCon
,
parrTyCon
,
parrTyConName
)
...
...
@@ -60,6 +61,7 @@ mAX_NDP_COMBINE = 2
mkNDPModule
::
FastString
->
Module
mkNDPModule
m
=
mkModule
ndpPackageId
(
mkModuleNameFS
m
)
nDP_UARR
=
mkNDPModule
FSLIT
(
"Data.Array.Parallel.Unlifted.Flat.UArr"
)
nDP_PARRAY
=
mkNDPModule
FSLIT
(
"Data.Array.Parallel.Lifted.PArray"
)
nDP_REPR
=
mkNDPModule
FSLIT
(
"Data.Array.Parallel.Lifted.Repr"
)
nDP_CLOSURE
=
mkNDPModule
FSLIT
(
"Data.Array.Parallel.Lifted.Closure"
)
...
...
@@ -78,7 +80,7 @@ data Builtins = Builtins {
,
preprTyCon
::
TyCon
,
prTyCon
::
TyCon
,
prDataCon
::
DataCon
,
p
arr
ayIntPrimTyCon
::
TyCon
,
u
arr
TyCon
::
TyCon
,
voidTyCon
::
TyCon
,
wrapTyCon
::
TyCon
,
enumerationTyCon
::
TyCon
...
...
@@ -102,6 +104,12 @@ data Builtins = Builtins {
,
liftingContext
::
Var
}
uarrTy
::
Type
->
Builtins
->
Type
uarrTy
ty
bi
=
mkTyConApp
(
uarrTyCon
bi
)
[
ty
]
intPrimArrayTy
::
Builtins
->
Type
intPrimArrayTy
=
uarrTy
intTy
sumTyCon
::
Int
->
Builtins
->
TyCon
sumTyCon
n
bi
|
n
>=
2
&&
n
<=
mAX_NDP_SUM
=
sumTyCons
bi
!
n
...
...
@@ -127,7 +135,7 @@ initBuiltins
preprTyCon
<-
externalTyCon
nDP_PARRAY
FSLIT
(
"PRepr"
)
prTyCon
<-
externalTyCon
nDP_PARRAY
FSLIT
(
"PR"
)
let
[
prDataCon
]
=
tyConDataCons
prTyCon
p
arr
ayIntPrim
TyCon
<-
externalTyCon
nDP_U
NBOXED
FSLIT
(
"
P
Arr
ay_Int#
"
)
u
arrTyCon
<-
externalTyCon
nDP_U
ARR
FSLIT
(
"
U
Arr"
)
closureTyCon
<-
externalTyCon
nDP_CLOSURE
FSLIT
(
":->"
)
voidTyCon
<-
externalTyCon
nDP_REPR
FSLIT
(
"Void"
)
...
...
@@ -168,7 +176,7 @@ initBuiltins
,
preprTyCon
=
preprTyCon
,
prTyCon
=
prTyCon
,
prDataCon
=
prDataCon
,
p
arr
ayIntPrimTyCon
=
p
arr
ayIntPrim
TyCon
,
u
arr
TyCon
=
u
arrTyCon
,
voidTyCon
=
voidTyCon
,
wrapTyCon
=
wrapTyCon
,
enumerationTyCon
=
enumerationTyCon
...
...
@@ -373,3 +381,4 @@ primPArray tycon
prim_ty_cons
=
mkNameEnv
[
mk_prim
intPrimTyCon
]
where
mk_prim
tycon
=
(
tyConName
tycon
,
'_'
:
getOccString
tycon
)
compiler/vectorise/VectMonad.hs
View file @
57bb5a4f
...
...
@@ -14,7 +14,8 @@ module VectMonad (
cloneName
,
cloneId
,
cloneVar
,
newExportedVar
,
newLocalVar
,
newDummyVar
,
newTyVar
,
Builtins
(
..
),
sumTyCon
,
prodTyCon
,
combinePAVar
,
Builtins
(
..
),
sumTyCon
,
prodTyCon
,
uarrTy
,
intPrimArrayTy
,
combinePAVar
,
builtin
,
builtins
,
GlobalEnv
(
..
),
...
...
compiler/vectorise/VectType.hs
View file @
57bb5a4f
...
...
@@ -366,8 +366,8 @@ arrShapeTys (EnumRepr {}) = sumShapeTys
sumShapeTys
::
VM
[
Type
]
sumShapeTys
=
do
int_arr
<-
builtin
parrayIntPrimTyCon
return
[
intPrimTy
,
mkTyConApp
int_arr
[]
,
mkTyConApp
int_arr
[]
]
int_arr
<-
builtin
intPrimArrayTy
return
[
intPrimTy
,
int_arr
,
int_arr
]
arrShapeVars
::
Repr
->
VM
[
Var
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment