Remove short_read_src cgen code path

This commit is contained in:
Nigel Tao committed 2018-08-04 09:45:35 +10:00
1 parent eca5565821
commit f2ee78aa2a
4 files changed
+124 -148

No files matched your search

+3 -4
View File
@@ -429,8 +429,8 @@ func (g *gen) writeBuiltinCallSuspendibles(b *buffer, n *a.Expr, depth uint32) e
temp := g.currFunk.tempW
g.currFunk.tempW++
b.printf("if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) { goto short_read_src; }")
g.currFunk.shortReads = append(g.currFunk.shortReads, "src")
b.printf("if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {" +
"status = WUFFS_BASE__SUSPENSION_SHORT_READ; goto suspend; }")
// TODO: watch for passing an array type to writeCTypeName? In C, an
// array type can decay into a pointer.
@@ -491,8 +491,7 @@ func (g *gen) writeBuiltinCallSuspendibles(b *buffer, n *a.Expr, depth uint32) e
b.printf("%s -= iobounds1_src - ioptr_src;\n", scratchName)
b.printf("ioptr_src = iobounds1_src;\n")
b.writes("goto short_read_src; }\n")
g.currFunk.shortReads = append(g.currFunk.shortReads, "src")
b.writes("status = WUFFS_BASE__SUSPENSION_SHORT_READ; goto suspend; }\n")
b.printf("ioptr_src += %s;\n", scratchName)
return nil
}
-14
View File
@@ -41,7 +41,6 @@ type funk struct {
suspendible bool // TODO: rename to coroutine.
usesScratch bool
hasGotoOK bool
shortReads []string
}
func (k *funk) jumpTarget(n a.Loop) (uint32, error) {
@@ -344,19 +343,6 @@ func (g *gen) writeFuncImplFooter(b *buffer) error {
b.writes("self->private_impl.status = status;\n")
}
b.writes("return status;\n\n")
shortReadsSeen := map[string]struct{}{}
for _, sr := range g.currFunk.shortReads {
if _, ok := shortReadsSeen[sr]; ok {
continue
}
shortReadsSeen[sr] = struct{}{}
if err := template_short_read(b, template_args_short_read{
name: sr,
}); err != nil {
return err
}
}
}
return nil
}
+3 -3
View File
@@ -570,9 +570,9 @@ func (g *gen) writeReadUXX(b *buffer, n *a.Expr, name string, size uint32, endia
}
b.printf("while (true) {")
b.printf("if (WUFFS_BASE__UNLIKELY(ioptr_%s == iobounds1_%s)) { goto short_read_%s; }",
name, name, name)
g.currFunk.shortReads = append(g.currFunk.shortReads, name)
b.printf("if (WUFFS_BASE__UNLIKELY(ioptr_%s == iobounds1_%s)) {"+
"status = WUFFS_BASE__SUSPENSION_SHORT_READ; goto suspend; }",
name, name)
b.printf("uint64_t *scratch = &%s;", scratchName)
b.printf("uint32_t %s%d = *scratch", tPrefix, temp0)
+118 -127
View File
@@ -4945,7 +4945,8 @@ wuffs_deflate__decoder__decode_blocks(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
self->private_impl.f_bits |=
@@ -5046,10 +5047,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func deflate.decoder.decode_uncompressed
@@ -5125,7 +5122,8 @@ wuffs_deflate__decoder__decode_uncompressed(wuffs_deflate__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch =
&self->private_impl.c_decode_uncompressed[0].scratch;
@@ -5188,10 +5186,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func deflate.decoder.init_fixed_huffman
@@ -5323,7 +5317,8 @@ wuffs_deflate__decoder__init_dynamic_huffman(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_bits |= (((uint32_t)(t_0)) << v_n_bits);
@@ -5351,7 +5346,8 @@ wuffs_deflate__decoder__init_dynamic_huffman(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_1 = *ioptr_src++;
v_bits |= (((uint32_t)(t_1)) << v_n_bits);
@@ -5389,7 +5385,8 @@ wuffs_deflate__decoder__init_dynamic_huffman(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_2 = *ioptr_src++;
v_bits |= (((uint32_t)(t_2)) << v_n_bits);
@@ -5436,7 +5433,8 @@ wuffs_deflate__decoder__init_dynamic_huffman(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_3 = *ioptr_src++;
v_bits |= (((uint32_t)(t_3)) << v_n_bits);
@@ -5509,10 +5507,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func deflate.decoder.init_huff
@@ -6231,7 +6225,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_bits |= (((uint32_t)(t_0)) << v_n_bits);
@@ -6272,7 +6267,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(3);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_1 = *ioptr_src++;
v_bits |= (((uint32_t)(t_1)) << v_n_bits);
@@ -6319,7 +6315,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_2 = *ioptr_src++;
v_bits |= (((uint32_t)(t_2)) << v_n_bits);
@@ -6343,7 +6340,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(6);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_3 = *ioptr_src++;
v_bits |= (((uint32_t)(t_3)) << v_n_bits);
@@ -6372,7 +6370,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(7);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_4 = *ioptr_src++;
v_bits |= (((uint32_t)(t_4)) << v_n_bits);
@@ -6397,7 +6396,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(8);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_5 = *ioptr_src++;
v_bits |= (((uint32_t)(t_5)) << v_n_bits);
@@ -6541,10 +6541,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
#endif // !defined(WUFFS_CONFIG__MODULES) ||
@@ -6995,7 +6991,8 @@ wuffs_gif__decoder__skip_frame(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_lw = t_0;
@@ -7038,10 +7035,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_frame
@@ -7152,7 +7145,8 @@ wuffs_gif__decoder__decode_up_to_id_part1(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_block_type = t_0;
@@ -7211,10 +7205,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_header
@@ -7259,7 +7249,8 @@ wuffs_gif__decoder__decode_header(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_c[v_i] = t_0;
@@ -7291,10 +7282,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_lsd
@@ -7348,7 +7335,8 @@ wuffs_gif__decoder__decode_lsd(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_lsd[0].scratch;
uint32_t t_0 = *scratch >> 56;
@@ -7376,7 +7364,8 @@ wuffs_gif__decoder__decode_lsd(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_lsd[0].scratch;
uint32_t t_2 = *scratch >> 56;
@@ -7396,7 +7385,8 @@ wuffs_gif__decoder__decode_lsd(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_4 = *ioptr_src++;
v_flags = t_4;
@@ -7408,7 +7398,8 @@ wuffs_gif__decoder__decode_lsd(wuffs_gif__decoder* self,
((uint64_t)(iobounds1_src - ioptr_src))) {
self->private_impl.c_decode_lsd[0].scratch -= iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode_lsd[0].scratch;
if ((v_flags & 128) != 0) {
@@ -7426,7 +7417,8 @@ wuffs_gif__decoder__decode_lsd(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(9);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_lsd[0].scratch;
uint32_t t_5 = *scratch & 0xFF;
@@ -7485,10 +7477,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_extension
@@ -7528,7 +7516,8 @@ wuffs_gif__decoder__decode_extension(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_label = t_0;
@@ -7592,10 +7581,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.skip_blocks
@@ -7636,7 +7621,8 @@ wuffs_gif__decoder__skip_blocks(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_block_size = t_0;
@@ -7653,7 +7639,8 @@ wuffs_gif__decoder__skip_blocks(wuffs_gif__decoder* self,
self->private_impl.c_skip_blocks[0].scratch -=
iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_skip_blocks[0].scratch;
}
@@ -7676,10 +7663,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_ae
@@ -7728,7 +7711,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_block_size = t_0;
@@ -7746,7 +7730,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
self->private_impl.c_decode_ae[0].scratch -=
iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode_ae[0].scratch;
goto label_0_break;
@@ -7758,7 +7743,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_1 = *ioptr_src++;
v_c = t_1;
@@ -7775,7 +7761,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_2 = *ioptr_src++;
v_block_size = t_2;
@@ -7789,7 +7776,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
self->private_impl.c_decode_ae[0].scratch -=
iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode_ae[0].scratch;
goto label_0_break;
@@ -7797,7 +7785,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(8);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_3 = *ioptr_src++;
v_c = t_3;
@@ -7811,7 +7800,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
self->private_impl.c_decode_ae[0].scratch -=
iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode_ae[0].scratch;
goto label_0_break;
@@ -7827,7 +7817,8 @@ wuffs_gif__decoder__decode_ae(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(12);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_ae[0].scratch;
uint32_t t_4 = *scratch >> 56;
@@ -7885,10 +7876,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_gc
@@ -7933,7 +7920,8 @@ wuffs_gif__decoder__decode_gc(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_c = t_0;
@@ -7945,7 +7933,8 @@ wuffs_gif__decoder__decode_gc(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_1 = *ioptr_src++;
v_flags = t_1;
@@ -7970,7 +7959,8 @@ wuffs_gif__decoder__decode_gc(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_gc[0].scratch;
uint32_t t_2 = *scratch >> 56;
@@ -7990,7 +7980,8 @@ wuffs_gif__decoder__decode_gc(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_4 = *ioptr_src++;
self->private_impl.f_gc_transparent_index = t_4;
@@ -7998,7 +7989,8 @@ wuffs_gif__decoder__decode_gc(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(6);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_5 = *ioptr_src++;
v_c = t_5;
@@ -8028,10 +8020,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_id_part0
@@ -8086,7 +8074,8 @@ wuffs_gif__decoder__decode_id_part0(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_id_part0[0].scratch;
uint32_t t_0 = *scratch >> 56;
@@ -8114,7 +8103,8 @@ wuffs_gif__decoder__decode_id_part0(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_id_part0[0].scratch;
uint32_t t_2 = *scratch >> 56;
@@ -8142,7 +8132,8 @@ wuffs_gif__decoder__decode_id_part0(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(6);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_id_part0[0].scratch;
uint32_t t_4 = *scratch >> 56;
@@ -8171,7 +8162,8 @@ wuffs_gif__decoder__decode_id_part0(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(8);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode_id_part0[0].scratch;
uint32_t t_6 = *scratch >> 56;
@@ -8200,7 +8192,8 @@ wuffs_gif__decoder__decode_id_part0(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(9);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_8 = *ioptr_src++;
v_flags = t_8;
@@ -8228,7 +8221,8 @@ wuffs_gif__decoder__decode_id_part0(wuffs_gif__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(11);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch =
&self->private_impl.c_decode_id_part0[0].scratch;
@@ -8288,10 +8282,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.decode_id_part1
@@ -8378,7 +8368,8 @@ wuffs_gif__decoder__decode_id_part1(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_lw = t_0;
@@ -8394,7 +8385,8 @@ wuffs_gif__decoder__decode_id_part1(wuffs_gif__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_1 = *ioptr_src++;
v_block_size = ((uint64_t)(t_1));
@@ -8500,10 +8492,6 @@ exit:
}
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
// -------- func gif.decoder.copy_to_image_buffer
@@ -8824,7 +8812,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_c = t_0;
@@ -8836,7 +8825,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_1 = *ioptr_src++;
v_c = t_1;
@@ -8848,7 +8838,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(3);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_2 = *ioptr_src++;
v_c = t_2;
@@ -8860,7 +8851,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_3 = *ioptr_src++;
v_flags = t_3;
@@ -8872,7 +8864,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
((uint64_t)(iobounds1_src - ioptr_src))) {
self->private_impl.c_decode[0].scratch -= iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode[0].scratch;
if ((v_flags & 4) != 0) {
@@ -8887,7 +8880,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(8);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode[0].scratch;
uint32_t t_4 = *scratch >> 56;
@@ -8911,7 +8905,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
((uint64_t)(iobounds1_src - ioptr_src))) {
self->private_impl.c_decode[0].scratch -= iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode[0].scratch;
}
@@ -8920,7 +8915,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(11);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_6 = *ioptr_src++;
v_c = t_6;
@@ -8936,7 +8932,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(12);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_7 = *ioptr_src++;
v_c = t_7;
@@ -8955,7 +8952,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
((uint64_t)(iobounds1_src - ioptr_src))) {
self->private_impl.c_decode[0].scratch -= iobounds1_src - ioptr_src;
ioptr_src = iobounds1_src;
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
ioptr_src += self->private_impl.c_decode[0].scratch;
}
@@ -9018,7 +9016,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(17);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode[0].scratch;
uint32_t t_9 = *scratch >> 56;
@@ -9046,7 +9045,8 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(19);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode[0].scratch;
uint32_t t_11 = *scratch >> 56;
@@ -9099,10 +9099,6 @@ exit:
self->private_impl.status = status;
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
#endif // !defined(WUFFS_CONFIG__MODULES) ||
@@ -9324,7 +9320,8 @@ wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint8_t t_0 = *ioptr_src++;
v_bits |= (((uint32_t)(t_0)) << v_n_bits);
@@ -9443,10 +9440,6 @@ exit:
self->private_impl.status = status;
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
#endif // !defined(WUFFS_CONFIG__MODULES) || defined(WUFFS_CONFIG__MODULE__LZW)
@@ -9658,7 +9651,8 @@ wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode[0].scratch;
uint32_t t_0 = *scratch & 0xFF;
@@ -9737,7 +9731,8 @@ wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
while (true) {
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
uint64_t* scratch = &self->private_impl.c_decode[0].scratch;
uint32_t t_3 = *scratch & 0xFF;
@@ -9785,10 +9780,6 @@ exit:
self->private_impl.status = status;
return status;
short_read_src:
status = WUFFS_BASE__SUSPENSION_SHORT_READ;
goto suspend;
}
#endif // !defined(WUFFS_CONFIG__MODULES) ||