Files
wuffs/lang/check/data.go
T
Nigel Tao e403659c05 Remove more branches in std/png filters
wuffs_png_decode_19k_8bpp/clang9          95.5MB/s ± 0%  91.8MB/s ± 1%   -3.90%  (p=0.008 n=5+5)
wuffs_png_decode_40k_24bpp/clang9          115MB/s ± 0%   115MB/s ± 1%     ~     (p=0.151 n=5+5)
wuffs_png_decode_77k_8bpp/clang9           358MB/s ± 0%   345MB/s ± 0%   -3.68%  (p=0.008 n=5+5)
wuffs_png_decode_552k_32bpp/clang9         124MB/s ± 0%   152MB/s ± 1%  +22.35%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/clang9        116MB/s ± 0%   116MB/s ± 0%     ~     (p=0.151 n=5+5)

wuffs_png_decode_filter_1_sub/clang9       924MB/s ± 0%   982MB/s ± 0%   +6.28%  (p=0.008 n=5+5)
wuffs_png_decode_filter_2_up/clang9       13.1GB/s ± 0%  12.7GB/s ± 0%   -2.73%  (p=0.008 n=5+5)
wuffs_png_decode_filter_3_average/clang9   640MB/s ± 0%   757MB/s ± 0%  +18.31%  (p=0.008 n=5+5)
wuffs_png_decode_filter_4_paeth/clang9    64.8MB/s ± 0%  82.1MB/s ± 0%  +26.72%  (p=0.008 n=5+5)

wuffs_png_decode_19k_8bpp/gcc10           99.0MB/s ± 0%  98.9MB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_png_decode_40k_24bpp/gcc10           114MB/s ± 1%   118MB/s ± 1%   +3.38%  (p=0.008 n=5+5)
wuffs_png_decode_77k_8bpp/gcc10            320MB/s ± 0%   321MB/s ± 0%   +0.38%  (p=0.016 n=5+4)
wuffs_png_decode_552k_32bpp/gcc10          141MB/s ± 0%   144MB/s ± 0%   +1.80%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/gcc10         118MB/s ± 0%   118MB/s ± 1%     ~     (p=0.151 n=5+5)

wuffs_png_decode_filter_1_sub/gcc10       1.11GB/s ± 0%  0.90GB/s ± 0%  -18.57%  (p=0.008 n=5+5)
wuffs_png_decode_filter_2_up/gcc10        11.1GB/s ± 0%  11.0GB/s ± 0%   -0.33%  (p=0.008 n=5+5)
wuffs_png_decode_filter_3_average/gcc10    751MB/s ± 0%   749MB/s ± 0%   -0.29%  (p=0.008 n=5+5)
wuffs_png_decode_filter_4_paeth/gcc10     76.9MB/s ± 0%  81.8MB/s ± 0%   +6.33%  (p=0.008 n=5+5)
2021-01-02 23:07:04 +11:00

443 lines
10 KiB
Go

// Code generated by running "go generate". DO NOT EDIT.
// Copyright 2017 The Wuffs Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package check
import (
a "github.com/google/wuffs/lang/ast"
t "github.com/google/wuffs/lang/token"
)
var reasons = [...]struct {
s string
r reason
}{
{`"a < b: b > a"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
// b > a
if err := proveReasonRequirement(q, t.IDXBinaryGreaterThan, xb, xa); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"a < b: a < c; c < b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
// a < c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xa, xc); err != nil {
return err
}
// c < b
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a < b: a < c; c == b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
// a < c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xa, xc); err != nil {
return err
}
// c == b
if err := proveReasonRequirement(q, t.IDXBinaryEqEq, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a < b: a == c; c < b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
// a == c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryEqEq, xa, xc); err != nil {
return err
}
// c < b
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a < b: a < c; c <= b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
// a < c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xa, xc); err != nil {
return err
}
// c <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a < b: a <= c; c < b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
// a <= c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xa, xc); err != nil {
return err
}
// c < b
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a > b: b < a"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryGreaterThan {
return errFailed
}
// b < a
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xb, xa); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"a <= b: a == b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
// a == b
if err := proveReasonRequirement(q, t.IDXBinaryEqEq, xa, xb); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"a <= b: b >= a"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
// b >= a
if err := proveReasonRequirement(q, t.IDXBinaryGreaterEq, xb, xa); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"a <= b: a <= c; c <= b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
// a <= c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xa, xc); err != nil {
return err
}
// c <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a <= b: a <= c; c == b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
// a <= c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xa, xc); err != nil {
return err
}
// c == b
if err := proveReasonRequirement(q, t.IDXBinaryEqEq, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a <= b: a == c; c <= b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
// a == c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryEqEq, xa, xc); err != nil {
return err
}
// c <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xc, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a >= b: a == b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryGreaterEq {
return errFailed
}
// a == b
if err := proveReasonRequirement(q, t.IDXBinaryEqEq, xa, xb); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"a >= b: b <= a"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryGreaterEq {
return errFailed
}
// b <= a
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xb, xa); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"a >= b: a >= (b + c); 0 <= c"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op != t.IDXBinaryGreaterEq {
return errFailed
}
// a >= (b + c)
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
t0 := a.NewExpr(0, t.IDXBinaryPlus, 0, xb.AsNode(), nil, xc.AsNode(), nil)
if err := proveReasonRequirement(q, t.IDXBinaryGreaterEq, xa, t0); err != nil {
return err
}
// 0 <= c
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, zeroExpr, xc); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a < (b + c): a < c; 0 <= b"`, func(q *checker, n *a.Assert) error {
op, xa, t0 := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
op, xb, xc := parseBinaryOp(t0)
if op != t.IDXBinaryPlus {
return errFailed
}
// a < c
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xa, xc); err != nil {
return err
}
// 0 <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, zeroExpr, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"a < (b + c): a < (b0 + c0); b0 <= b; c0 <= c"`, func(q *checker, n *a.Assert) error {
op, xa, t0 := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
op, xb, xc := parseBinaryOp(t0)
if op != t.IDXBinaryPlus {
return errFailed
}
// a < (b0 + c0)
xb0 := argValue(q.tm, n.Args(), "b0")
if xb0 == nil {
return errFailed
}
xc0 := argValue(q.tm, n.Args(), "c0")
if xc0 == nil {
return errFailed
}
t1 := a.NewExpr(0, t.IDXBinaryPlus, 0, xb0.AsNode(), nil, xc0.AsNode(), nil)
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xa, t1); err != nil {
return err
}
// b0 <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xb0, xb); err != nil {
return err
}
// c0 <= c
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xc0, xc); err != nil {
return err
}
_ = xa
_ = xb
_ = xb0
_ = xc
_ = xc0
return nil
}},
{`"a <= (a + b): 0 <= b"`, func(q *checker, n *a.Assert) error {
op, xa, t0 := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
op, xa, xb := parseBinaryOp(t0)
if op != t.IDXBinaryPlus {
return errFailed
}
// 0 <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, zeroExpr, xb); err != nil {
return err
}
_ = xa
_ = xb
return nil
}},
{`"(a + b) <= c: a <= (c - b)"`, func(q *checker, n *a.Assert) error {
op, t0, xc := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessEq {
return errFailed
}
op, xa, xb := parseBinaryOp(t0)
if op != t.IDXBinaryPlus {
return errFailed
}
// a <= (c - b)
t1 := a.NewExpr(0, t.IDXBinaryMinus, 0, xc.AsNode(), nil, xb.AsNode(), nil)
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xa, t1); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
{`"(a - b) < c: a < c; 0 <= b"`, func(q *checker, n *a.Assert) error {
op, t0, xc := parseBinaryOp(n.Condition())
if op != t.IDXBinaryLessThan {
return errFailed
}
op, xa, xb := parseBinaryOp(t0)
if op != t.IDXBinaryMinus {
return errFailed
}
// a < c
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xa, xc); err != nil {
return err
}
// 0 <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, zeroExpr, xb); err != nil {
return err
}
_ = xa
_ = xb
_ = xc
return nil
}},
}