cgen: emit "break/continue" not "goto", part 2

name                                             old speed     new speed     delta

wuffs_jpeg_decode_19k_8bpp/clang11               241MB/s ± 0%  241MB/s ± 0%    ~     (p=0.690 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11  213MB/s ± 0%  213MB/s ± 0%    ~     (p=0.690 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11   386MB/s ± 0%  387MB/s ± 0%    ~     (p=0.270 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11              341MB/s ± 0%  341MB/s ± 0%    ~     (p=0.556 n=5+4)
wuffs_jpeg_decode_552k_24bpp_420/clang11         356MB/s ± 0%  356MB/s ± 0%    ~     (p=0.310 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11         484MB/s ± 0%  484MB/s ± 0%    ~     (p=0.095 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/clang11            362MB/s ± 0%  364MB/s ± 0%    ~     (p=0.095 n=5+5)

wuffs_jpeg_decode_19k_8bpp/gcc10                 245MB/s ± 0%  244MB/s ± 0%  -0.19%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10    252MB/s ± 0%  254MB/s ± 0%  +0.76%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10     513MB/s ± 0%  508MB/s ± 0%  -0.88%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10                433MB/s ± 0%  434MB/s ± 0%  +0.38%  (p=0.016 n=4+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10           458MB/s ± 0%  456MB/s ± 0%  -0.41%  (p=0.029 n=4+4)
wuffs_jpeg_decode_552k_24bpp_444/gcc10           486MB/s ± 0%  481MB/s ± 0%  -1.00%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10              465MB/s ± 0%  463MB/s ± 0%  -0.39%  (p=0.029 n=4+4)
This commit is contained in:
Nigel Tao committed 2023-06-23 18:29:20 +10:00
1 parent f155db4d5c
commit de55ff7746
2 files changed
+60 -92

No files matched your search

+4 -6
View File
@@ -540,10 +540,9 @@ func (g *gen) writeStatementJump(b *buffer, n *a.Jump, depth uint32) error {
if n.Keyword() == t.IDBreak {
keyword = "break"
}
// TODO: apply to all generated code, not just
// wuffs_jpeg__decoder__fill_bitstream.
// TODO: apply to all generated code, not just wuffs_jpeg__etc.
if (n.JumpTarget() == g.currFunk.activeLoops.Top()) &&
(g.currFunk.cName == "wuffs_jpeg__decoder__fill_bitstream") {
(strings.HasPrefix(g.currFunk.cName, "wuffs_jpeg__")) {
b.printf("%s;\n", keyword)
return nil
}
@@ -633,9 +632,8 @@ func (g *gen) writeStatementRet(b *buffer, n *a.Ret, depth uint32) error {
}
func (g *gen) writeStatementWhile(b *buffer, n *a.While, depth uint32) error {
// TODO: apply to all generated code, not just
// wuffs_jpeg__decoder__fill_bitstream.
stagedRollout := g.currFunk.cName != "wuffs_jpeg__decoder__fill_bitstream"
// TODO: apply to all generated code, not just wuffs_jpeg__etc.
stagedRollout := !strings.HasPrefix(g.currFunk.cName, "wuffs_jpeg__")
if n.HasDeepContinue() || (stagedRollout && n.HasContinue()) {
jt, err := g.currFunk.jumpTarget(g.tm, n)