mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Generate placeholders for an iterate step:8 body
This commit is contained in:
1 parent
c511c53b1f
commit
33746151aa
3 files changed
+14
-3
No files matched your search
@@ -243,10 +243,15 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
|
||||
|
||||
unroll := n.Unroll().SmallPowerOf2Value()
|
||||
step := n.Step().SmallPowerOf2Value()
|
||||
// TODO: remove the "step == 1" hack.
|
||||
if uStep := unroll * step; uStep != 1 && step == 1 {
|
||||
if uStep := unroll * step; uStep != 1 {
|
||||
// TODO: remove this hack.
|
||||
hack := 1
|
||||
if step != 1 {
|
||||
hack = 0
|
||||
}
|
||||
|
||||
b.printf("uint8_t* %send0_%s = %sslice_%s.ptr + (%sslice_%s.len / %d) * %d;\n",
|
||||
iPrefix, name, iPrefix, name, iPrefix, name, uStep, uStep)
|
||||
iPrefix, name, iPrefix, name, iPrefix, name, uStep, uStep*hack)
|
||||
b.printf("while (%s%s < %send0_%s) {\n", vPrefix, name, iPrefix, name)
|
||||
for i := 0; i < unroll; i++ {
|
||||
for _, o := range n.Body() {
|
||||
|
||||
Reference in new issue
Block a user