Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
sv2v
Commits
fc9b0b59
Commit
fc9b0b59
authored
May 05, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
streamline stream conversion
parent
3e85885d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
src/Convert/Stream.hs
+7
-9
No files found.
src/Convert/Stream.hs
View file @
fc9b0b59
...
...
@@ -23,11 +23,9 @@ streamerBlock chunk size asgn output input =
[
Variable
Local
t
inp
[]
$
Just
input
,
Variable
Local
t
out
[]
Nothing
,
Variable
Local
(
IntegerAtom
TInteger
Unspecified
)
idx
[]
Nothing
,
Variable
Local
(
IntegerAtom
TInteger
Unspecified
)
bas
[]
Nothing
]
[
For
inits
cmp
incr
stmt
,
Asgn
AsgnOpEq
Nothing
(
LHSIdent
bas
)
(
Ident
idx
)
,
For
inits
cmp2
incr2
stmt2
,
If
NoCheck
cmp2
stmt2
Null
,
asgn
output
(
Ident
out
)
]
where
...
...
@@ -38,20 +36,20 @@ streamerBlock chunk size asgn output input =
inp
=
name
++
"_inp"
out
=
name
++
"_out"
idx
=
name
++
"_idx"
bas
=
name
++
"_bas"
-- main chunk loop
inits
=
Right
[(
LHSIdent
idx
,
lo
)]
cmp
=
BinOp
L
e
(
Ident
idx
)
(
BinOp
Sub
hi
chunk
)
cmp
=
BinOp
L
t
(
Ident
idx
)
base
incr
=
[(
LHSIdent
idx
,
AsgnOp
Add
,
chunk
)]
lhs
=
LHSRange
(
LHSIdent
out
)
IndexedMinus
(
BinOp
Sub
hi
(
Ident
idx
),
chunk
)
expr
=
Range
(
Ident
inp
)
IndexedPlus
(
Ident
idx
,
chunk
)
stmt
=
Asgn
AsgnOpEq
Nothing
lhs
expr
base
=
BinOp
Mul
(
BinOp
Div
size
chunk
)
chunk
-- final chunk loop
cmp2
=
BinOp
Lt
(
Ident
idx
)
(
BinOp
Sub
size
(
Ident
bas
))
incr2
=
[(
LHSIdent
idx
,
AsgnOp
Add
,
Number
"1"
)]
lhs2
=
LHSBit
(
LHSIdent
out
)
(
Ident
idx
)
expr2
=
Bit
(
Ident
inp
)
(
BinOp
Add
(
Ident
idx
)
(
Ident
bas
))
left
=
BinOp
Sub
size
base
lhs2
=
LHSRange
(
LHSIdent
out
)
IndexedMinus
(
BinOp
Sub
hi
base
,
left
)
expr2
=
Range
(
Ident
inp
)
IndexedPlus
(
base
,
left
)
stmt2
=
Asgn
AsgnOpEq
Nothing
lhs2
expr2
cmp2
=
BinOp
Gt
left
(
Number
"0"
)
streamerBlockName
::
Expr
->
Expr
->
Identifier
streamerBlockName
chunk
size
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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