diff --git a/go.mod b/go.mod index 924e8cc9a..e388d2a55 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( codeberg.org/gruf/go-debug v1.3.0 codeberg.org/gruf/go-errors/v2 v2.2.0 codeberg.org/gruf/go-fastcopy v1.1.2 + codeberg.org/gruf/go-iotools v0.0.0-20221224124424-3386841cb225 codeberg.org/gruf/go-kv v1.6.1 codeberg.org/gruf/go-logger/v2 v2.2.1 codeberg.org/gruf/go-mutexes v1.1.5 @@ -35,7 +36,7 @@ require ( github.com/jackc/pgx/v5 v5.3.1 github.com/microcosm-cc/bluemonday v1.0.23 github.com/miekg/dns v1.1.54 - github.com/minio/minio-go/v7 v7.0.53 + github.com/minio/minio-go/v7 v7.0.55 github.com/mitchellh/mapstructure v1.5.0 github.com/oklog/ulid v1.3.1 github.com/spf13/cobra v1.7.0 @@ -77,7 +78,6 @@ require ( codeberg.org/gruf/go-fastpath v1.0.3 // indirect codeberg.org/gruf/go-fastpath/v2 v2.0.0 // indirect codeberg.org/gruf/go-hashenc v1.0.2 // indirect - codeberg.org/gruf/go-iotools v0.0.0-20221224124424-3386841cb225 // indirect codeberg.org/gruf/go-mangler v1.2.3 // indirect codeberg.org/gruf/go-maps v1.0.3 // indirect codeberg.org/gruf/go-pools v1.1.0 // indirect @@ -128,13 +128,13 @@ require ( github.com/jinzhu/inflection v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-isatty v0.0.18 // indirect github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/sha256-simd v1.0.0 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/opencontainers/runtime-spec v1.0.2 // indirect @@ -143,8 +143,8 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quasoft/memstore v0.0.0-20191010062613-2bce066d2b0b // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/rs/xid v1.4.0 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/sirupsen/logrus v1.9.2 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/go.sum b/go.sum index 5e11314d2..28641d151 100644 --- a/go.sum +++ b/go.sum @@ -409,10 +409,9 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= @@ -452,10 +451,10 @@ github.com/miekg/dns v1.1.54 h1:5jon9mWcb0sFJGpnI99tOMhCPyJ+RPVz5b63MQG0VWI= github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.53 h1:qtPyQ+b0Cc1ums3LsnVMAYULPNdAGz8qdX8R2zl9XMU= -github.com/minio/minio-go/v7 v7.0.53/go.mod h1:IbbodHyjUAguneyucUaahv+VMNs/EOTV9du7A7/Z3HU= -github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= -github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/minio/minio-go/v7 v7.0.55 h1:ZXqUO/8cgfHzI+08h/zGuTTFpISSA32BZmBE3FCLJas= +github.com/minio/minio-go/v7 v7.0.55/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -501,8 +500,8 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -513,8 +512,8 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= +github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= diff --git a/vendor/github.com/klauspost/compress/gzip/gunzip.go b/vendor/github.com/klauspost/compress/gzip/gunzip.go index 66fe5ddf7..6d630c390 100644 --- a/vendor/github.com/klauspost/compress/gzip/gunzip.go +++ b/vendor/github.com/klauspost/compress/gzip/gunzip.go @@ -288,10 +288,35 @@ func (z *Reader) Read(p []byte) (n int, err error) { return n, nil } -// Support the io.WriteTo interface for io.Copy and friends. +type crcer interface { + io.Writer + Sum32() uint32 + Reset() +} +type crcUpdater struct { + z *Reader +} + +func (c *crcUpdater) Write(p []byte) (int, error) { + c.z.digest = crc32.Update(c.z.digest, crc32.IEEETable, p) + return len(p), nil +} + +func (c *crcUpdater) Sum32() uint32 { + return c.z.digest +} + +func (c *crcUpdater) Reset() { + c.z.digest = 0 +} + +// WriteTo support the io.WriteTo interface for io.Copy and friends. func (z *Reader) WriteTo(w io.Writer) (int64, error) { total := int64(0) - crcWriter := crc32.NewIEEE() + crcWriter := crcer(crc32.NewIEEE()) + if z.digest != 0 { + crcWriter = &crcUpdater{z: z} + } for { if z.err != nil { if z.err == io.EOF { diff --git a/vendor/github.com/klauspost/compress/s2/decode.go b/vendor/github.com/klauspost/compress/s2/decode.go index b7c9adfdd..6c7feafcc 100644 --- a/vendor/github.com/klauspost/compress/s2/decode.go +++ b/vendor/github.com/klauspost/compress/s2/decode.go @@ -9,12 +9,7 @@ import ( "encoding/binary" "errors" "fmt" - "io" - "io/ioutil" - "math" - "runtime" "strconv" - "sync" ) var ( @@ -28,16 +23,6 @@ var ( ErrUnsupported = errors.New("s2: unsupported input") ) -// ErrCantSeek is returned if the stream cannot be seeked. -type ErrCantSeek struct { - Reason string -} - -// Error returns the error as string. -func (e ErrCantSeek) Error() string { - return fmt.Sprintf("s2: Can't seek because %s", e.Reason) -} - // DecodedLen returns the length of the decoded block. func DecodedLen(src []byte) (int, error) { v, _, err := decodedLen(src) @@ -84,1035 +69,6 @@ func Decode(dst, src []byte) ([]byte, error) { return dst, nil } -// NewReader returns a new Reader that decompresses from r, using the framing -// format described at -// https://github.com/google/snappy/blob/master/framing_format.txt with S2 changes. -func NewReader(r io.Reader, opts ...ReaderOption) *Reader { - nr := Reader{ - r: r, - maxBlock: maxBlockSize, - } - for _, opt := range opts { - if err := opt(&nr); err != nil { - nr.err = err - return &nr - } - } - nr.maxBufSize = MaxEncodedLen(nr.maxBlock) + checksumSize - if nr.lazyBuf > 0 { - nr.buf = make([]byte, MaxEncodedLen(nr.lazyBuf)+checksumSize) - } else { - nr.buf = make([]byte, MaxEncodedLen(defaultBlockSize)+checksumSize) - } - nr.readHeader = nr.ignoreStreamID - nr.paramsOK = true - return &nr -} - -// ReaderOption is an option for creating a decoder. -type ReaderOption func(*Reader) error - -// ReaderMaxBlockSize allows to control allocations if the stream -// has been compressed with a smaller WriterBlockSize, or with the default 1MB. -// Blocks must be this size or smaller to decompress, -// otherwise the decoder will return ErrUnsupported. -// -// For streams compressed with Snappy this can safely be set to 64KB (64 << 10). -// -// Default is the maximum limit of 4MB. -func ReaderMaxBlockSize(blockSize int) ReaderOption { - return func(r *Reader) error { - if blockSize > maxBlockSize || blockSize <= 0 { - return errors.New("s2: block size too large. Must be <= 4MB and > 0") - } - if r.lazyBuf == 0 && blockSize < defaultBlockSize { - r.lazyBuf = blockSize - } - r.maxBlock = blockSize - return nil - } -} - -// ReaderAllocBlock allows to control upfront stream allocations -// and not allocate for frames bigger than this initially. -// If frames bigger than this is seen a bigger buffer will be allocated. -// -// Default is 1MB, which is default output size. -func ReaderAllocBlock(blockSize int) ReaderOption { - return func(r *Reader) error { - if blockSize > maxBlockSize || blockSize < 1024 { - return errors.New("s2: invalid ReaderAllocBlock. Must be <= 4MB and >= 1024") - } - r.lazyBuf = blockSize - return nil - } -} - -// ReaderIgnoreStreamIdentifier will make the reader skip the expected -// stream identifier at the beginning of the stream. -// This can be used when serving a stream that has been forwarded to a specific point. -func ReaderIgnoreStreamIdentifier() ReaderOption { - return func(r *Reader) error { - r.ignoreStreamID = true - return nil - } -} - -// ReaderSkippableCB will register a callback for chuncks with the specified ID. -// ID must be a Reserved skippable chunks ID, 0x80-0xfd (inclusive). -// For each chunk with the ID, the callback is called with the content. -// Any returned non-nil error will abort decompression. -// Only one callback per ID is supported, latest sent will be used. -func ReaderSkippableCB(id uint8, fn func(r io.Reader) error) ReaderOption { - return func(r *Reader) error { - if id < 0x80 || id > 0xfd { - return fmt.Errorf("ReaderSkippableCB: Invalid id provided, must be 0x80-0xfd (inclusive)") - } - r.skippableCB[id] = fn - return nil - } -} - -// ReaderIgnoreCRC will make the reader skip CRC calculation and checks. -func ReaderIgnoreCRC() ReaderOption { - return func(r *Reader) error { - r.ignoreCRC = true - return nil - } -} - -// Reader is an io.Reader that can read Snappy-compressed bytes. -type Reader struct { - r io.Reader - err error - decoded []byte - buf []byte - skippableCB [0x80]func(r io.Reader) error - blockStart int64 // Uncompressed offset at start of current. - index *Index - - // decoded[i:j] contains decoded bytes that have not yet been passed on. - i, j int - // maximum block size allowed. - maxBlock int - // maximum expected buffer size. - maxBufSize int - // alloc a buffer this size if > 0. - lazyBuf int - readHeader bool - paramsOK bool - snappyFrame bool - ignoreStreamID bool - ignoreCRC bool -} - -// ensureBufferSize will ensure that the buffer can take at least n bytes. -// If false is returned the buffer exceeds maximum allowed size. -func (r *Reader) ensureBufferSize(n int) bool { - if n > r.maxBufSize { - r.err = ErrCorrupt - return false - } - if cap(r.buf) >= n { - return true - } - // Realloc buffer. - r.buf = make([]byte, n) - return true -} - -// Reset discards any buffered data, resets all state, and switches the Snappy -// reader to read from r. This permits reusing a Reader rather than allocating -// a new one. -func (r *Reader) Reset(reader io.Reader) { - if !r.paramsOK { - return - } - r.index = nil - r.r = reader - r.err = nil - r.i = 0 - r.j = 0 - r.blockStart = 0 - r.readHeader = r.ignoreStreamID -} - -func (r *Reader) readFull(p []byte, allowEOF bool) (ok bool) { - if _, r.err = io.ReadFull(r.r, p); r.err != nil { - if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { - r.err = ErrCorrupt - } - return false - } - return true -} - -// skippable will skip n bytes. -// If the supplied reader supports seeking that is used. -// tmp is used as a temporary buffer for reading. -// The supplied slice does not need to be the size of the read. -func (r *Reader) skippable(tmp []byte, n int, allowEOF bool, id uint8) (ok bool) { - if id < 0x80 { - r.err = fmt.Errorf("interbal error: skippable id < 0x80") - return false - } - if fn := r.skippableCB[id-0x80]; fn != nil { - rd := io.LimitReader(r.r, int64(n)) - r.err = fn(rd) - if r.err != nil { - return false - } - _, r.err = io.CopyBuffer(ioutil.Discard, rd, tmp) - return r.err == nil - } - if rs, ok := r.r.(io.ReadSeeker); ok { - _, err := rs.Seek(int64(n), io.SeekCurrent) - if err == nil { - return true - } - if err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { - r.err = ErrCorrupt - return false - } - } - for n > 0 { - if n < len(tmp) { - tmp = tmp[:n] - } - if _, r.err = io.ReadFull(r.r, tmp); r.err != nil { - if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { - r.err = ErrCorrupt - } - return false - } - n -= len(tmp) - } - return true -} - -// Read satisfies the io.Reader interface. -func (r *Reader) Read(p []byte) (int, error) { - if r.err != nil { - return 0, r.err - } - for { - if r.i < r.j { - n := copy(p, r.decoded[r.i:r.j]) - r.i += n - return n, nil - } - if !r.readFull(r.buf[:4], true) { - return 0, r.err - } - chunkType := r.buf[0] - if !r.readHeader { - if chunkType != chunkTypeStreamIdentifier { - r.err = ErrCorrupt - return 0, r.err - } - r.readHeader = true - } - chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 - - // The chunk types are specified at - // https://github.com/google/snappy/blob/master/framing_format.txt - switch chunkType { - case chunkTypeCompressedData: - r.blockStart += int64(r.j) - // Section 4.2. Compressed data (chunk type 0x00). - if chunkLen < checksumSize { - r.err = ErrCorrupt - return 0, r.err - } - if !r.ensureBufferSize(chunkLen) { - if r.err == nil { - r.err = ErrUnsupported - } - return 0, r.err - } - buf := r.buf[:chunkLen] - if !r.readFull(buf, false) { - return 0, r.err - } - checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 - buf = buf[checksumSize:] - - n, err := DecodedLen(buf) - if err != nil { - r.err = err - return 0, r.err - } - if r.snappyFrame && n > maxSnappyBlockSize { - r.err = ErrCorrupt - return 0, r.err - } - - if n > len(r.decoded) { - if n > r.maxBlock { - r.err = ErrCorrupt - return 0, r.err - } - r.decoded = make([]byte, n) - } - if _, err := Decode(r.decoded, buf); err != nil { - r.err = err - return 0, r.err - } - if !r.ignoreCRC && crc(r.decoded[:n]) != checksum { - r.err = ErrCRC - return 0, r.err - } - r.i, r.j = 0, n - continue - - case chunkTypeUncompressedData: - r.blockStart += int64(r.j) - // Section 4.3. Uncompressed data (chunk type 0x01). - if chunkLen < checksumSize { - r.err = ErrCorrupt - return 0, r.err - } - if !r.ensureBufferSize(chunkLen) { - if r.err == nil { - r.err = ErrUnsupported - } - return 0, r.err - } - buf := r.buf[:checksumSize] - if !r.readFull(buf, false) { - return 0, r.err - } - checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 - // Read directly into r.decoded instead of via r.buf. - n := chunkLen - checksumSize - if r.snappyFrame && n > maxSnappyBlockSize { - r.err = ErrCorrupt - return 0, r.err - } - if n > len(r.decoded) { - if n > r.maxBlock { - r.err = ErrCorrupt - return 0, r.err - } - r.decoded = make([]byte, n) - } - if !r.readFull(r.decoded[:n], false) { - return 0, r.err - } - if !r.ignoreCRC && crc(r.decoded[:n]) != checksum { - r.err = ErrCRC - return 0, r.err - } - r.i, r.j = 0, n - continue - - case chunkTypeStreamIdentifier: - // Section 4.1. Stream identifier (chunk type 0xff). - if chunkLen != len(magicBody) { - r.err = ErrCorrupt - return 0, r.err - } - if !r.readFull(r.buf[:len(magicBody)], false) { - return 0, r.err - } - if string(r.buf[:len(magicBody)]) != magicBody { - if string(r.buf[:len(magicBody)]) != magicBodySnappy { - r.err = ErrCorrupt - return 0, r.err - } else { - r.snappyFrame = true - } - } else { - r.snappyFrame = false - } - continue - } - - if chunkType <= 0x7f { - // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). - // fmt.Printf("ERR chunktype: 0x%x\n", chunkType) - r.err = ErrUnsupported - return 0, r.err - } - // Section 4.4 Padding (chunk type 0xfe). - // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). - if chunkLen > maxChunkSize { - // fmt.Printf("ERR chunkLen: 0x%x\n", chunkLen) - r.err = ErrUnsupported - return 0, r.err - } - - // fmt.Printf("skippable: ID: 0x%x, len: 0x%x\n", chunkType, chunkLen) - if !r.skippable(r.buf, chunkLen, false, chunkType) { - return 0, r.err - } - } -} - -// DecodeConcurrent will decode the full stream to w. -// This function should not be combined with reading, seeking or other operations. -// Up to 'concurrent' goroutines will be used. -// If <= 0, runtime.NumCPU will be used. -// On success the number of bytes decompressed nil and is returned. -// This is mainly intended for bigger streams. -func (r *Reader) DecodeConcurrent(w io.Writer, concurrent int) (written int64, err error) { - if r.i > 0 || r.j > 0 || r.blockStart > 0 { - return 0, errors.New("DecodeConcurrent called after ") - } - if concurrent <= 0 { - concurrent = runtime.NumCPU() - } - - // Write to output - var errMu sync.Mutex - var aErr error - setErr := func(e error) (ok bool) { - errMu.Lock() - defer errMu.Unlock() - if e == nil { - return aErr == nil - } - if aErr == nil { - aErr = e - } - return false - } - hasErr := func() (ok bool) { - errMu.Lock() - v := aErr != nil - errMu.Unlock() - return v - } - - var aWritten int64 - toRead := make(chan []byte, concurrent) - writtenBlocks := make(chan []byte, concurrent) - queue := make(chan chan []byte, concurrent) - reUse := make(chan chan []byte, concurrent) - for i := 0; i < concurrent; i++ { - toRead <- make([]byte, 0, r.maxBufSize) - writtenBlocks <- make([]byte, 0, r.maxBufSize) - reUse <- make(chan []byte, 1) - } - // Writer - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - for toWrite := range queue { - entry := <-toWrite - reUse <- toWrite - if hasErr() { - writtenBlocks <- entry - continue - } - n, err := w.Write(entry) - want := len(entry) - writtenBlocks <- entry - if err != nil { - setErr(err) - continue - } - if n != want { - setErr(io.ErrShortWrite) - continue - } - aWritten += int64(n) - } - }() - - // Reader - defer func() { - close(queue) - if r.err != nil { - err = r.err - setErr(r.err) - } - wg.Wait() - if err == nil { - err = aErr - } - written = aWritten - }() - - for !hasErr() { - if !r.readFull(r.buf[:4], true) { - if r.err == io.EOF { - r.err = nil - } - return 0, r.err - } - chunkType := r.buf[0] - if !r.readHeader { - if chunkType != chunkTypeStreamIdentifier { - r.err = ErrCorrupt - return 0, r.err - } - r.readHeader = true - } - chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 - - // The chunk types are specified at - // https://github.com/google/snappy/blob/master/framing_format.txt - switch chunkType { - case chunkTypeCompressedData: - r.blockStart += int64(r.j) - // Section 4.2. Compressed data (chunk type 0x00). - if chunkLen < checksumSize { - r.err = ErrCorrupt - return 0, r.err - } - if chunkLen > r.maxBufSize { - r.err = ErrCorrupt - return 0, r.err - } - orgBuf := <-toRead - buf := orgBuf[:chunkLen] - - if !r.readFull(buf, false) { - return 0, r.err - } - - checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 - buf = buf[checksumSize:] - - n, err := DecodedLen(buf) - if err != nil { - r.err = err - return 0, r.err - } - if r.snappyFrame && n > maxSnappyBlockSize { - r.err = ErrCorrupt - return 0, r.err - } - - if n > r.maxBlock { - r.err = ErrCorrupt - return 0, r.err - } - wg.Add(1) - - decoded := <-writtenBlocks - entry := <-reUse - queue <- entry - go func() { - defer wg.Done() - decoded = decoded[:n] - _, err := Decode(decoded, buf) - toRead <- orgBuf - if err != nil { - writtenBlocks <- decoded - setErr(err) - return - } - if !r.ignoreCRC && crc(decoded) != checksum { - writtenBlocks <- decoded - setErr(ErrCRC) - return - } - entry <- decoded - }() - continue - - case chunkTypeUncompressedData: - - // Section 4.3. Uncompressed data (chunk type 0x01). - if chunkLen < checksumSize { - r.err = ErrCorrupt - return 0, r.err - } - if chunkLen > r.maxBufSize { - r.err = ErrCorrupt - return 0, r.err - } - // Grab write buffer - orgBuf := <-writtenBlocks - buf := orgBuf[:checksumSize] - if !r.readFull(buf, false) { - return 0, r.err - } - checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 - // Read content. - n := chunkLen - checksumSize - - if r.snappyFrame && n > maxSnappyBlockSize { - r.err = ErrCorrupt - return 0, r.err - } - if n > r.maxBlock { - r.err = ErrCorrupt - return 0, r.err - } - // Read uncompressed - buf = orgBuf[:n] - if !r.readFull(buf, false) { - return 0, r.err - } - - if !r.ignoreCRC && crc(buf) != checksum { - r.err = ErrCRC - return 0, r.err - } - entry := <-reUse - queue <- entry - entry <- buf - continue - - case chunkTypeStreamIdentifier: - // Section 4.1. Stream identifier (chunk type 0xff). - if chunkLen != len(magicBody) { - r.err = ErrCorrupt - return 0, r.err - } - if !r.readFull(r.buf[:len(magicBody)], false) { - return 0, r.err - } - if string(r.buf[:len(magicBody)]) != magicBody { - if string(r.buf[:len(magicBody)]) != magicBodySnappy { - r.err = ErrCorrupt - return 0, r.err - } else { - r.snappyFrame = true - } - } else { - r.snappyFrame = false - } - continue - } - - if chunkType <= 0x7f { - // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). - // fmt.Printf("ERR chunktype: 0x%x\n", chunkType) - r.err = ErrUnsupported - return 0, r.err - } - // Section 4.4 Padding (chunk type 0xfe). - // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). - if chunkLen > maxChunkSize { - // fmt.Printf("ERR chunkLen: 0x%x\n", chunkLen) - r.err = ErrUnsupported - return 0, r.err - } - - // fmt.Printf("skippable: ID: 0x%x, len: 0x%x\n", chunkType, chunkLen) - if !r.skippable(r.buf, chunkLen, false, chunkType) { - return 0, r.err - } - } - return 0, r.err -} - -// Skip will skip n bytes forward in the decompressed output. -// For larger skips this consumes less CPU and is faster than reading output and discarding it. -// CRC is not checked on skipped blocks. -// io.ErrUnexpectedEOF is returned if the stream ends before all bytes have been skipped. -// If a decoding error is encountered subsequent calls to Read will also fail. -func (r *Reader) Skip(n int64) error { - if n < 0 { - return errors.New("attempted negative skip") - } - if r.err != nil { - return r.err - } - - for n > 0 { - if r.i < r.j { - // Skip in buffer. - // decoded[i:j] contains decoded bytes that have not yet been passed on. - left := int64(r.j - r.i) - if left >= n { - tmp := int64(r.i) + n - if tmp > math.MaxInt32 { - return errors.New("s2: internal overflow in skip") - } - r.i = int(tmp) - return nil - } - n -= int64(r.j - r.i) - r.i = r.j - } - - // Buffer empty; read blocks until we have content. - if !r.readFull(r.buf[:4], true) { - if r.err == io.EOF { - r.err = io.ErrUnexpectedEOF - } - return r.err - } - chunkType := r.buf[0] - if !r.readHeader { - if chunkType != chunkTypeStreamIdentifier { - r.err = ErrCorrupt - return r.err - } - r.readHeader = true - } - chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 - - // The chunk types are specified at - // https://github.com/google/snappy/blob/master/framing_format.txt - switch chunkType { - case chunkTypeCompressedData: - r.blockStart += int64(r.j) - // Section 4.2. Compressed data (chunk type 0x00). - if chunkLen < checksumSize { - r.err = ErrCorrupt - return r.err - } - if !r.ensureBufferSize(chunkLen) { - if r.err == nil { - r.err = ErrUnsupported - } - return r.err - } - buf := r.buf[:chunkLen] - if !r.readFull(buf, false) { - return r.err - } - checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 - buf = buf[checksumSize:] - - dLen, err := DecodedLen(buf) - if err != nil { - r.err = err - return r.err - } - if dLen > r.maxBlock { - r.err = ErrCorrupt - return r.err - } - // Check if destination is within this block - if int64(dLen) > n { - if len(r.decoded) < dLen { - r.decoded = make([]byte, dLen) - } - if _, err := Decode(r.decoded, buf); err != nil { - r.err = err - return r.err - } - if crc(r.decoded[:dLen]) != checksum { - r.err = ErrCorrupt - return r.err - } - } else { - // Skip block completely - n -= int64(dLen) - r.blockStart += int64(dLen) - dLen = 0 - } - r.i, r.j = 0, dLen - continue - case chunkTypeUncompressedData: - r.blockStart += int64(r.j) - // Section 4.3. Uncompressed data (chunk type 0x01). - if chunkLen < checksumSize { - r.err = ErrCorrupt - return r.err - } - if !r.ensureBufferSize(chunkLen) { - if r.err != nil { - r.err = ErrUnsupported - } - return r.err - } - buf := r.buf[:checksumSize] - if !r.readFull(buf, false) { - return r.err - } - checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 - // Read directly into r.decoded instead of via r.buf. - n2 := chunkLen - checksumSize - if n2 > len(r.decoded) { - if n2 > r.maxBlock { - r.err = ErrCorrupt - return r.err - } - r.decoded = make([]byte, n2) - } - if !r.readFull(r.decoded[:n2], false) { - return r.err - } - if int64(n2) < n { - if crc(r.decoded[:n2]) != checksum { - r.err = ErrCorrupt - return r.err - } - } - r.i, r.j = 0, n2 - continue - case chunkTypeStreamIdentifier: - // Section 4.1. Stream identifier (chunk type 0xff). - if chunkLen != len(magicBody) { - r.err = ErrCorrupt - return r.err - } - if !r.readFull(r.buf[:len(magicBody)], false) { - return r.err - } - if string(r.buf[:len(magicBody)]) != magicBody { - if string(r.buf[:len(magicBody)]) != magicBodySnappy { - r.err = ErrCorrupt - return r.err - } - } - - continue - } - - if chunkType <= 0x7f { - // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). - r.err = ErrUnsupported - return r.err - } - if chunkLen > maxChunkSize { - r.err = ErrUnsupported - return r.err - } - // Section 4.4 Padding (chunk type 0xfe). - // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). - if !r.skippable(r.buf, chunkLen, false, chunkType) { - return r.err - } - } - return nil -} - -// ReadSeeker provides random or forward seeking in compressed content. -// See Reader.ReadSeeker -type ReadSeeker struct { - *Reader - readAtMu sync.Mutex -} - -// ReadSeeker will return an io.ReadSeeker and io.ReaderAt -// compatible version of the reader. -// If 'random' is specified the returned io.Seeker can be used for -// random seeking, otherwise only forward seeking is supported. -// Enabling random seeking requires the original input to support -// the io.Seeker interface. -// A custom index can be specified which will be used if supplied. -// When using a custom index, it will not be read from the input stream. -// The ReadAt position will affect regular reads and the current position of Seek. -// So using Read after ReadAt will continue from where the ReadAt stopped. -// No functions should be used concurrently. -// The returned ReadSeeker contains a shallow reference to the existing Reader, -// meaning changes performed to one is reflected in the other. -func (r *Reader) ReadSeeker(random bool, index []byte) (*ReadSeeker, error) { - // Read index if provided. - if len(index) != 0 { - if r.index == nil { - r.index = &Index{} - } - if _, err := r.index.Load(index); err != nil { - return nil, ErrCantSeek{Reason: "loading index returned: " + err.Error()} - } - } - - // Check if input is seekable - rs, ok := r.r.(io.ReadSeeker) - if !ok { - if !random { - return &ReadSeeker{Reader: r}, nil - } - return nil, ErrCantSeek{Reason: "input stream isn't seekable"} - } - - if r.index != nil { - // Seekable and index, ok... - return &ReadSeeker{Reader: r}, nil - } - - // Load from stream. - r.index = &Index{} - - // Read current position. - pos, err := rs.Seek(0, io.SeekCurrent) - if err != nil { - return nil, ErrCantSeek{Reason: "seeking input returned: " + err.Error()} - } - err = r.index.LoadStream(rs) - if err != nil { - if err == ErrUnsupported { - // If we don't require random seeking, reset input and return. - if !random { - _, err = rs.Seek(pos, io.SeekStart) - if err != nil { - return nil, ErrCantSeek{Reason: "resetting stream returned: " + err.Error()} - } - r.index = nil - return &ReadSeeker{Reader: r}, nil - } - return nil, ErrCantSeek{Reason: "input stream does not contain an index"} - } - return nil, ErrCantSeek{Reason: "reading index returned: " + err.Error()} - } - - // reset position. - _, err = rs.Seek(pos, io.SeekStart) - if err != nil { - return nil, ErrCantSeek{Reason: "seeking input returned: " + err.Error()} - } - return &ReadSeeker{Reader: r}, nil -} - -// Seek allows seeking in compressed data. -func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error) { - if r.err != nil { - if !errors.Is(r.err, io.EOF) { - return 0, r.err - } - // Reset on EOF - r.err = nil - } - - // Calculate absolute offset. - absOffset := offset - - switch whence { - case io.SeekStart: - case io.SeekCurrent: - absOffset = r.blockStart + int64(r.i) + offset - case io.SeekEnd: - if r.index == nil { - return 0, ErrUnsupported - } - absOffset = r.index.TotalUncompressed + offset - default: - r.err = ErrUnsupported - return 0, r.err - } - - if absOffset < 0 { - return 0, errors.New("seek before start of file") - } - - if !r.readHeader { - // Make sure we read the header. - _, r.err = r.Read([]byte{}) - if r.err != nil { - return 0, r.err - } - } - - // If we are inside current block no need to seek. - // This includes no offset changes. - if absOffset >= r.blockStart && absOffset < r.blockStart+int64(r.j) { - r.i = int(absOffset - r.blockStart) - return r.blockStart + int64(r.i), nil - } - - rs, ok := r.r.(io.ReadSeeker) - if r.index == nil || !ok { - currOffset := r.blockStart + int64(r.i) - if absOffset >= currOffset { - err := r.Skip(absOffset - currOffset) - return r.blockStart + int64(r.i), err - } - return 0, ErrUnsupported - } - - // We can seek and we have an index. - c, u, err := r.index.Find(absOffset) - if err != nil { - return r.blockStart + int64(r.i), err - } - - // Seek to next block - _, err = rs.Seek(c, io.SeekStart) - if err != nil { - return 0, err - } - - r.i = r.j // Remove rest of current block. - r.blockStart = u - int64(r.j) // Adjust current block start for accounting. - if u < absOffset { - // Forward inside block - return absOffset, r.Skip(absOffset - u) - } - if u > absOffset { - return 0, fmt.Errorf("s2 seek: (internal error) u (%d) > absOffset (%d)", u, absOffset) - } - return absOffset, nil -} - -// ReadAt reads len(p) bytes into p starting at offset off in the -// underlying input source. It returns the number of bytes -// read (0 <= n <= len(p)) and any error encountered. -// -// When ReadAt returns n < len(p), it returns a non-nil error -// explaining why more bytes were not returned. In this respect, -// ReadAt is stricter than Read. -// -// Even if ReadAt returns n < len(p), it may use all of p as scratch -// space during the call. If some data is available but not len(p) bytes, -// ReadAt blocks until either all the data is available or an error occurs. -// In this respect ReadAt is different from Read. -// -// If the n = len(p) bytes returned by ReadAt are at the end of the -// input source, ReadAt may return either err == EOF or err == nil. -// -// If ReadAt is reading from an input source with a seek offset, -// ReadAt should not affect nor be affected by the underlying -// seek offset. -// -// Clients of ReadAt can execute parallel ReadAt calls on the -// same input source. This is however not recommended. -func (r *ReadSeeker) ReadAt(p []byte, offset int64) (int, error) { - r.readAtMu.Lock() - defer r.readAtMu.Unlock() - _, err := r.Seek(offset, io.SeekStart) - if err != nil { - return 0, err - } - n := 0 - for n < len(p) { - n2, err := r.Read(p[n:]) - if err != nil { - // This will include io.EOF - return n + n2, err - } - n += n2 - } - return n, nil -} - -// ReadByte satisfies the io.ByteReader interface. -func (r *Reader) ReadByte() (byte, error) { - if r.err != nil { - return 0, r.err - } - if r.i < r.j { - c := r.decoded[r.i] - r.i++ - return c, nil - } - var tmp [1]byte - for i := 0; i < 10; i++ { - n, err := r.Read(tmp[:]) - if err != nil { - return 0, err - } - if n == 1 { - return tmp[0], nil - } - } - return 0, io.ErrNoProgress -} - -// SkippableCB will register a callback for chunks with the specified ID. -// ID must be a Reserved skippable chunks ID, 0x80-0xfe (inclusive). -// For each chunk with the ID, the callback is called with the content. -// Any returned non-nil error will abort decompression. -// Only one callback per ID is supported, latest sent will be used. -// Sending a nil function will disable previous callbacks. -func (r *Reader) SkippableCB(id uint8, fn func(r io.Reader) error) error { - if id < 0x80 || id > chunkTypePadding { - return fmt.Errorf("ReaderSkippableCB: Invalid id provided, must be 0x80-0xfe (inclusive)") - } - r.skippableCB[id] = fn - return nil -} - // s2DecodeDict writes the decoding of src to dst. It assumes that the varint-encoded // length of the decompressed bytes has already been read, and that len(dst) // equals that length. diff --git a/vendor/github.com/klauspost/compress/s2/encode.go b/vendor/github.com/klauspost/compress/s2/encode.go index c2ca7236a..e6c231021 100644 --- a/vendor/github.com/klauspost/compress/s2/encode.go +++ b/vendor/github.com/klauspost/compress/s2/encode.go @@ -6,15 +6,9 @@ package s2 import ( - "crypto/rand" "encoding/binary" - "errors" - "fmt" - "io" "math" "math/bits" - "runtime" - "sync" ) // Encode returns the encoded form of src. The returned slice may be a sub- @@ -355,9 +349,12 @@ const inputMargin = 8 // will be accepted by the encoder. const minNonLiteralBlockSize = 32 +const intReduction = 2 - (1 << (^uint(0) >> 63)) // 1 (32 bits) or 0 (64 bits) + // MaxBlockSize is the maximum value where MaxEncodedLen will return a valid block size. // Blocks this big are highly discouraged, though. -const MaxBlockSize = math.MaxUint32 - binary.MaxVarintLen32 - 5 +// Half the size on 32 bit systems. +const MaxBlockSize = (1<<(32-intReduction) - 1) - binary.MaxVarintLen32 - 5 // MaxEncodedLen returns the maximum length of a snappy block, given its // uncompressed length. @@ -366,7 +363,14 @@ const MaxBlockSize = math.MaxUint32 - binary.MaxVarintLen32 - 5 // 32 bit platforms will have lower thresholds for rejecting big content. func MaxEncodedLen(srcLen int) int { n := uint64(srcLen) - if n > 0xffffffff { + if intReduction == 1 { + // 32 bits + if n > math.MaxInt32 { + // Also includes negative. + return -1 + } + } else if n > 0xffffffff { + // 64 bits // Also includes negative. return -1 } @@ -375,1009 +379,15 @@ func MaxEncodedLen(srcLen int) int { // Add maximum size of encoding block as literals. n += uint64(literalExtraSize(int64(srcLen))) - if n > 0xffffffff { + if intReduction == 1 { + // 32 bits + if n > math.MaxInt32 { + return -1 + } + } else if n > 0xffffffff { + // 64 bits + // Also includes negative. return -1 } return int(n) } - -var errClosed = errors.New("s2: Writer is closed") - -// NewWriter returns a new Writer that compresses to w, using the -// framing format described at -// https://github.com/google/snappy/blob/master/framing_format.txt -// -// Users must call Close to guarantee all data has been forwarded to -// the underlying io.Writer and that resources are released. -// They may also call Flush zero or more times before calling Close. -func NewWriter(w io.Writer, opts ...WriterOption) *Writer { - w2 := Writer{ - blockSize: defaultBlockSize, - concurrency: runtime.GOMAXPROCS(0), - randSrc: rand.Reader, - level: levelFast, - } - for _, opt := range opts { - if err := opt(&w2); err != nil { - w2.errState = err - return &w2 - } - } - w2.obufLen = obufHeaderLen + MaxEncodedLen(w2.blockSize) - w2.paramsOK = true - w2.ibuf = make([]byte, 0, w2.blockSize) - w2.buffers.New = func() interface{} { - return make([]byte, w2.obufLen) - } - w2.Reset(w) - return &w2 -} - -// Writer is an io.Writer that can write Snappy-compressed bytes. -type Writer struct { - errMu sync.Mutex - errState error - - // ibuf is a buffer for the incoming (uncompressed) bytes. - ibuf []byte - - blockSize int - obufLen int - concurrency int - written int64 - uncompWritten int64 // Bytes sent to compression - output chan chan result - buffers sync.Pool - pad int - - writer io.Writer - randSrc io.Reader - writerWg sync.WaitGroup - index Index - customEnc func(dst, src []byte) int - - // wroteStreamHeader is whether we have written the stream header. - wroteStreamHeader bool - paramsOK bool - snappy bool - flushOnWrite bool - appendIndex bool - level uint8 -} - -const ( - levelUncompressed = iota + 1 - levelFast - levelBetter - levelBest -) - -type result struct { - b []byte - // Uncompressed start offset - startOffset int64 -} - -// err returns the previously set error. -// If no error has been set it is set to err if not nil. -func (w *Writer) err(err error) error { - w.errMu.Lock() - errSet := w.errState - if errSet == nil && err != nil { - w.errState = err - errSet = err - } - w.errMu.Unlock() - return errSet -} - -// Reset discards the writer's state and switches the Snappy writer to write to w. -// This permits reusing a Writer rather than allocating a new one. -func (w *Writer) Reset(writer io.Writer) { - if !w.paramsOK { - return - } - // Close previous writer, if any. - if w.output != nil { - close(w.output) - w.writerWg.Wait() - w.output = nil - } - w.errState = nil - w.ibuf = w.ibuf[:0] - w.wroteStreamHeader = false - w.written = 0 - w.writer = writer - w.uncompWritten = 0 - w.index.reset(w.blockSize) - - // If we didn't get a writer, stop here. - if writer == nil { - return - } - // If no concurrency requested, don't spin up writer goroutine. - if w.concurrency == 1 { - return - } - - toWrite := make(chan chan result, w.concurrency) - w.output = toWrite - w.writerWg.Add(1) - - // Start a writer goroutine that will write all output in order. - go func() { - defer w.writerWg.Done() - - // Get a queued write. - for write := range toWrite { - // Wait for the data to be available. - input := <-write - in := input.b - if len(in) > 0 { - if w.err(nil) == nil { - // Don't expose data from previous buffers. - toWrite := in[:len(in):len(in)] - // Write to output. - n, err := writer.Write(toWrite) - if err == nil && n != len(toWrite) { - err = io.ErrShortBuffer - } - _ = w.err(err) - w.err(w.index.add(w.written, input.startOffset)) - w.written += int64(n) - } - } - if cap(in) >= w.obufLen { - w.buffers.Put(in) - } - // close the incoming write request. - // This can be used for synchronizing flushes. - close(write) - } - }() -} - -// Write satisfies the io.Writer interface. -func (w *Writer) Write(p []byte) (nRet int, errRet error) { - if err := w.err(nil); err != nil { - return 0, err - } - if w.flushOnWrite { - return w.write(p) - } - // If we exceed the input buffer size, start writing - for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err(nil) == nil { - var n int - if len(w.ibuf) == 0 { - // Large write, empty buffer. - // Write directly from p to avoid copy. - n, _ = w.write(p) - } else { - n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) - w.ibuf = w.ibuf[:len(w.ibuf)+n] - w.write(w.ibuf) - w.ibuf = w.ibuf[:0] - } - nRet += n - p = p[n:] - } - if err := w.err(nil); err != nil { - return nRet, err - } - // p should always be able to fit into w.ibuf now. - n := copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) - w.ibuf = w.ibuf[:len(w.ibuf)+n] - nRet += n - return nRet, nil -} - -// ReadFrom implements the io.ReaderFrom interface. -// Using this is typically more efficient since it avoids a memory copy. -// ReadFrom reads data from r until EOF or error. -// The return value n is the number of bytes read. -// Any error except io.EOF encountered during the read is also returned. -func (w *Writer) ReadFrom(r io.Reader) (n int64, err error) { - if err := w.err(nil); err != nil { - return 0, err - } - if len(w.ibuf) > 0 { - err := w.Flush() - if err != nil { - return 0, err - } - } - if br, ok := r.(byter); ok { - buf := br.Bytes() - if err := w.EncodeBuffer(buf); err != nil { - return 0, err - } - return int64(len(buf)), w.Flush() - } - for { - inbuf := w.buffers.Get().([]byte)[:w.blockSize+obufHeaderLen] - n2, err := io.ReadFull(r, inbuf[obufHeaderLen:]) - if err != nil { - if err == io.ErrUnexpectedEOF { - err = io.EOF - } - if err != io.EOF { - return n, w.err(err) - } - } - if n2 == 0 { - break - } - n += int64(n2) - err2 := w.writeFull(inbuf[:n2+obufHeaderLen]) - if w.err(err2) != nil { - break - } - - if err != nil { - // We got EOF and wrote everything - break - } - } - - return n, w.err(nil) -} - -// AddSkippableBlock will add a skippable block to the stream. -// The ID must be 0x80-0xfe (inclusive). -// Length of the skippable block must be <= 16777215 bytes. -func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) { - if err := w.err(nil); err != nil { - return err - } - if len(data) == 0 { - return nil - } - if id < 0x80 || id > chunkTypePadding { - return fmt.Errorf("invalid skippable block id %x", id) - } - if len(data) > maxChunkSize { - return fmt.Errorf("skippable block excessed maximum size") - } - var header [4]byte - chunkLen := 4 + len(data) - header[0] = id - header[1] = uint8(chunkLen >> 0) - header[2] = uint8(chunkLen >> 8) - header[3] = uint8(chunkLen >> 16) - if w.concurrency == 1 { - write := func(b []byte) error { - n, err := w.writer.Write(b) - if err = w.err(err); err != nil { - return err - } - if n != len(data) { - return w.err(io.ErrShortWrite) - } - w.written += int64(n) - return w.err(nil) - } - if !w.wroteStreamHeader { - w.wroteStreamHeader = true - if w.snappy { - if err := write([]byte(magicChunkSnappy)); err != nil { - return err - } - } else { - if err := write([]byte(magicChunk)); err != nil { - return err - } - } - } - if err := write(header[:]); err != nil { - return err - } - if err := write(data); err != nil { - return err - } - } - - // Create output... - if !w.wroteStreamHeader { - w.wroteStreamHeader = true - hWriter := make(chan result) - w.output <- hWriter - if w.snappy { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} - } else { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} - } - } - - // Copy input. - inbuf := w.buffers.Get().([]byte)[:4] - copy(inbuf, header[:]) - inbuf = append(inbuf, data...) - - output := make(chan result, 1) - // Queue output. - w.output <- output - output <- result{startOffset: w.uncompWritten, b: inbuf} - - return nil -} - -// EncodeBuffer will add a buffer to the stream. -// This is the fastest way to encode a stream, -// but the input buffer cannot be written to by the caller -// until Flush or Close has been called when concurrency != 1. -// -// If you cannot control that, use the regular Write function. -// -// Note that input is not buffered. -// This means that each write will result in discrete blocks being created. -// For buffered writes, use the regular Write function. -func (w *Writer) EncodeBuffer(buf []byte) (err error) { - if err := w.err(nil); err != nil { - return err - } - - if w.flushOnWrite { - _, err := w.write(buf) - return err - } - // Flush queued data first. - if len(w.ibuf) > 0 { - err := w.Flush() - if err != nil { - return err - } - } - if w.concurrency == 1 { - _, err := w.writeSync(buf) - return err - } - - // Spawn goroutine and write block to output channel. - if !w.wroteStreamHeader { - w.wroteStreamHeader = true - hWriter := make(chan result) - w.output <- hWriter - if w.snappy { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} - } else { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} - } - } - - for len(buf) > 0 { - // Cut input. - uncompressed := buf - if len(uncompressed) > w.blockSize { - uncompressed = uncompressed[:w.blockSize] - } - buf = buf[len(uncompressed):] - // Get an output buffer. - obuf := w.buffers.Get().([]byte)[:len(uncompressed)+obufHeaderLen] - output := make(chan result) - // Queue output now, so we keep order. - w.output <- output - res := result{ - startOffset: w.uncompWritten, - } - w.uncompWritten += int64(len(uncompressed)) - go func() { - checksum := crc(uncompressed) - - // Set to uncompressed. - chunkType := uint8(chunkTypeUncompressedData) - chunkLen := 4 + len(uncompressed) - - // Attempt compressing. - n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) - n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) - - // Check if we should use this, or store as uncompressed instead. - if n2 > 0 { - chunkType = uint8(chunkTypeCompressedData) - chunkLen = 4 + n + n2 - obuf = obuf[:obufHeaderLen+n+n2] - } else { - // copy uncompressed - copy(obuf[obufHeaderLen:], uncompressed) - } - - // Fill in the per-chunk header that comes before the body. - obuf[0] = chunkType - obuf[1] = uint8(chunkLen >> 0) - obuf[2] = uint8(chunkLen >> 8) - obuf[3] = uint8(chunkLen >> 16) - obuf[4] = uint8(checksum >> 0) - obuf[5] = uint8(checksum >> 8) - obuf[6] = uint8(checksum >> 16) - obuf[7] = uint8(checksum >> 24) - - // Queue final output. - res.b = obuf - output <- res - }() - } - return nil -} - -func (w *Writer) encodeBlock(obuf, uncompressed []byte) int { - if w.customEnc != nil { - return w.customEnc(obuf, uncompressed) - } - if w.snappy { - switch w.level { - case levelFast: - return encodeBlockSnappy(obuf, uncompressed) - case levelBetter: - return encodeBlockBetterSnappy(obuf, uncompressed) - case levelBest: - return encodeBlockBestSnappy(obuf, uncompressed) - } - return 0 - } - switch w.level { - case levelFast: - return encodeBlock(obuf, uncompressed) - case levelBetter: - return encodeBlockBetter(obuf, uncompressed) - case levelBest: - return encodeBlockBest(obuf, uncompressed, nil) - } - return 0 -} - -func (w *Writer) write(p []byte) (nRet int, errRet error) { - if err := w.err(nil); err != nil { - return 0, err - } - if w.concurrency == 1 { - return w.writeSync(p) - } - - // Spawn goroutine and write block to output channel. - for len(p) > 0 { - if !w.wroteStreamHeader { - w.wroteStreamHeader = true - hWriter := make(chan result) - w.output <- hWriter - if w.snappy { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} - } else { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} - } - } - - var uncompressed []byte - if len(p) > w.blockSize { - uncompressed, p = p[:w.blockSize], p[w.blockSize:] - } else { - uncompressed, p = p, nil - } - - // Copy input. - // If the block is incompressible, this is used for the result. - inbuf := w.buffers.Get().([]byte)[:len(uncompressed)+obufHeaderLen] - obuf := w.buffers.Get().([]byte)[:w.obufLen] - copy(inbuf[obufHeaderLen:], uncompressed) - uncompressed = inbuf[obufHeaderLen:] - - output := make(chan result) - // Queue output now, so we keep order. - w.output <- output - res := result{ - startOffset: w.uncompWritten, - } - w.uncompWritten += int64(len(uncompressed)) - - go func() { - checksum := crc(uncompressed) - - // Set to uncompressed. - chunkType := uint8(chunkTypeUncompressedData) - chunkLen := 4 + len(uncompressed) - - // Attempt compressing. - n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) - n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) - - // Check if we should use this, or store as uncompressed instead. - if n2 > 0 { - chunkType = uint8(chunkTypeCompressedData) - chunkLen = 4 + n + n2 - obuf = obuf[:obufHeaderLen+n+n2] - } else { - // Use input as output. - obuf, inbuf = inbuf, obuf - } - - // Fill in the per-chunk header that comes before the body. - obuf[0] = chunkType - obuf[1] = uint8(chunkLen >> 0) - obuf[2] = uint8(chunkLen >> 8) - obuf[3] = uint8(chunkLen >> 16) - obuf[4] = uint8(checksum >> 0) - obuf[5] = uint8(checksum >> 8) - obuf[6] = uint8(checksum >> 16) - obuf[7] = uint8(checksum >> 24) - - // Queue final output. - res.b = obuf - output <- res - - // Put unused buffer back in pool. - w.buffers.Put(inbuf) - }() - nRet += len(uncompressed) - } - return nRet, nil -} - -// writeFull is a special version of write that will always write the full buffer. -// Data to be compressed should start at offset obufHeaderLen and fill the remainder of the buffer. -// The data will be written as a single block. -// The caller is not allowed to use inbuf after this function has been called. -func (w *Writer) writeFull(inbuf []byte) (errRet error) { - if err := w.err(nil); err != nil { - return err - } - - if w.concurrency == 1 { - _, err := w.writeSync(inbuf[obufHeaderLen:]) - return err - } - - // Spawn goroutine and write block to output channel. - if !w.wroteStreamHeader { - w.wroteStreamHeader = true - hWriter := make(chan result) - w.output <- hWriter - if w.snappy { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} - } else { - hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} - } - } - - // Get an output buffer. - obuf := w.buffers.Get().([]byte)[:w.obufLen] - uncompressed := inbuf[obufHeaderLen:] - - output := make(chan result) - // Queue output now, so we keep order. - w.output <- output - res := result{ - startOffset: w.uncompWritten, - } - w.uncompWritten += int64(len(uncompressed)) - - go func() { - checksum := crc(uncompressed) - - // Set to uncompressed. - chunkType := uint8(chunkTypeUncompressedData) - chunkLen := 4 + len(uncompressed) - - // Attempt compressing. - n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) - n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) - - // Check if we should use this, or store as uncompressed instead. - if n2 > 0 { - chunkType = uint8(chunkTypeCompressedData) - chunkLen = 4 + n + n2 - obuf = obuf[:obufHeaderLen+n+n2] - } else { - // Use input as output. - obuf, inbuf = inbuf, obuf - } - - // Fill in the per-chunk header that comes before the body. - obuf[0] = chunkType - obuf[1] = uint8(chunkLen >> 0) - obuf[2] = uint8(chunkLen >> 8) - obuf[3] = uint8(chunkLen >> 16) - obuf[4] = uint8(checksum >> 0) - obuf[5] = uint8(checksum >> 8) - obuf[6] = uint8(checksum >> 16) - obuf[7] = uint8(checksum >> 24) - - // Queue final output. - res.b = obuf - output <- res - - // Put unused buffer back in pool. - w.buffers.Put(inbuf) - }() - return nil -} - -func (w *Writer) writeSync(p []byte) (nRet int, errRet error) { - if err := w.err(nil); err != nil { - return 0, err - } - if !w.wroteStreamHeader { - w.wroteStreamHeader = true - var n int - var err error - if w.snappy { - n, err = w.writer.Write([]byte(magicChunkSnappy)) - } else { - n, err = w.writer.Write([]byte(magicChunk)) - } - if err != nil { - return 0, w.err(err) - } - if n != len(magicChunk) { - return 0, w.err(io.ErrShortWrite) - } - w.written += int64(n) - } - - for len(p) > 0 { - var uncompressed []byte - if len(p) > w.blockSize { - uncompressed, p = p[:w.blockSize], p[w.blockSize:] - } else { - uncompressed, p = p, nil - } - - obuf := w.buffers.Get().([]byte)[:w.obufLen] - checksum := crc(uncompressed) - - // Set to uncompressed. - chunkType := uint8(chunkTypeUncompressedData) - chunkLen := 4 + len(uncompressed) - - // Attempt compressing. - n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) - n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) - - if n2 > 0 { - chunkType = uint8(chunkTypeCompressedData) - chunkLen = 4 + n + n2 - obuf = obuf[:obufHeaderLen+n+n2] - } else { - obuf = obuf[:8] - } - - // Fill in the per-chunk header that comes before the body. - obuf[0] = chunkType - obuf[1] = uint8(chunkLen >> 0) - obuf[2] = uint8(chunkLen >> 8) - obuf[3] = uint8(chunkLen >> 16) - obuf[4] = uint8(checksum >> 0) - obuf[5] = uint8(checksum >> 8) - obuf[6] = uint8(checksum >> 16) - obuf[7] = uint8(checksum >> 24) - - n, err := w.writer.Write(obuf) - if err != nil { - return 0, w.err(err) - } - if n != len(obuf) { - return 0, w.err(io.ErrShortWrite) - } - w.err(w.index.add(w.written, w.uncompWritten)) - w.written += int64(n) - w.uncompWritten += int64(len(uncompressed)) - - if chunkType == chunkTypeUncompressedData { - // Write uncompressed data. - n, err := w.writer.Write(uncompressed) - if err != nil { - return 0, w.err(err) - } - if n != len(uncompressed) { - return 0, w.err(io.ErrShortWrite) - } - w.written += int64(n) - } - w.buffers.Put(obuf) - // Queue final output. - nRet += len(uncompressed) - } - return nRet, nil -} - -// Flush flushes the Writer to its underlying io.Writer. -// This does not apply padding. -func (w *Writer) Flush() error { - if err := w.err(nil); err != nil { - return err - } - - // Queue any data still in input buffer. - if len(w.ibuf) != 0 { - if !w.wroteStreamHeader { - _, err := w.writeSync(w.ibuf) - w.ibuf = w.ibuf[:0] - return w.err(err) - } else { - _, err := w.write(w.ibuf) - w.ibuf = w.ibuf[:0] - err = w.err(err) - if err != nil { - return err - } - } - } - if w.output == nil { - return w.err(nil) - } - - // Send empty buffer - res := make(chan result) - w.output <- res - // Block until this has been picked up. - res <- result{b: nil, startOffset: w.uncompWritten} - // When it is closed, we have flushed. - <-res - return w.err(nil) -} - -// Close calls Flush and then closes the Writer. -// Calling Close multiple times is ok, -// but calling CloseIndex after this will make it not return the index. -func (w *Writer) Close() error { - _, err := w.closeIndex(w.appendIndex) - return err -} - -// CloseIndex calls Close and returns an index on first call. -// This is not required if you are only adding index to a stream. -func (w *Writer) CloseIndex() ([]byte, error) { - return w.closeIndex(true) -} - -func (w *Writer) closeIndex(idx bool) ([]byte, error) { - err := w.Flush() - if w.output != nil { - close(w.output) - w.writerWg.Wait() - w.output = nil - } - - var index []byte - if w.err(nil) == nil && w.writer != nil { - // Create index. - if idx { - compSize := int64(-1) - if w.pad <= 1 { - compSize = w.written - } - index = w.index.appendTo(w.ibuf[:0], w.uncompWritten, compSize) - // Count as written for padding. - if w.appendIndex { - w.written += int64(len(index)) - } - } - - if w.pad > 1 { - tmp := w.ibuf[:0] - if len(index) > 0 { - // Allocate another buffer. - tmp = w.buffers.Get().([]byte)[:0] - defer w.buffers.Put(tmp) - } - add := calcSkippableFrame(w.written, int64(w.pad)) - frame, err := skippableFrame(tmp, add, w.randSrc) - if err = w.err(err); err != nil { - return nil, err - } - n, err2 := w.writer.Write(frame) - if err2 == nil && n != len(frame) { - err2 = io.ErrShortWrite - } - _ = w.err(err2) - } - if len(index) > 0 && w.appendIndex { - n, err2 := w.writer.Write(index) - if err2 == nil && n != len(index) { - err2 = io.ErrShortWrite - } - _ = w.err(err2) - } - } - err = w.err(errClosed) - if err == errClosed { - return index, nil - } - return nil, err -} - -// calcSkippableFrame will return a total size to be added for written -// to be divisible by multiple. -// The value will always be > skippableFrameHeader. -// The function will panic if written < 0 or wantMultiple <= 0. -func calcSkippableFrame(written, wantMultiple int64) int { - if wantMultiple <= 0 { - panic("wantMultiple <= 0") - } - if written < 0 { - panic("written < 0") - } - leftOver := written % wantMultiple - if leftOver == 0 { - return 0 - } - toAdd := wantMultiple - leftOver - for toAdd < skippableFrameHeader { - toAdd += wantMultiple - } - return int(toAdd) -} - -// skippableFrame will add a skippable frame with a total size of bytes. -// total should be >= skippableFrameHeader and < maxBlockSize + skippableFrameHeader -func skippableFrame(dst []byte, total int, r io.Reader) ([]byte, error) { - if total == 0 { - return dst, nil - } - if total < skippableFrameHeader { - return dst, fmt.Errorf("s2: requested skippable frame (%d) < 4", total) - } - if int64(total) >= maxBlockSize+skippableFrameHeader { - return dst, fmt.Errorf("s2: requested skippable frame (%d) >= max 1<<24", total) - } - // Chunk type 0xfe "Section 4.4 Padding (chunk type 0xfe)" - dst = append(dst, chunkTypePadding) - f := uint32(total - skippableFrameHeader) - // Add chunk length. - dst = append(dst, uint8(f), uint8(f>>8), uint8(f>>16)) - // Add data - start := len(dst) - dst = append(dst, make([]byte, f)...) - _, err := io.ReadFull(r, dst[start:]) - return dst, err -} - -// WriterOption is an option for creating a encoder. -type WriterOption func(*Writer) error - -// WriterConcurrency will set the concurrency, -// meaning the maximum number of decoders to run concurrently. -// The value supplied must be at least 1. -// By default this will be set to GOMAXPROCS. -func WriterConcurrency(n int) WriterOption { - return func(w *Writer) error { - if n <= 0 { - return errors.New("concurrency must be at least 1") - } - w.concurrency = n - return nil - } -} - -// WriterAddIndex will append an index to the end of a stream -// when it is closed. -func WriterAddIndex() WriterOption { - return func(w *Writer) error { - w.appendIndex = true - return nil - } -} - -// WriterBetterCompression will enable better compression. -// EncodeBetter compresses better than Encode but typically with a -// 10-40% speed decrease on both compression and decompression. -func WriterBetterCompression() WriterOption { - return func(w *Writer) error { - w.level = levelBetter - return nil - } -} - -// WriterBestCompression will enable better compression. -// EncodeBetter compresses better than Encode but typically with a -// big speed decrease on compression. -func WriterBestCompression() WriterOption { - return func(w *Writer) error { - w.level = levelBest - return nil - } -} - -// WriterUncompressed will bypass compression. -// The stream will be written as uncompressed blocks only. -// If concurrency is > 1 CRC and output will still be done async. -func WriterUncompressed() WriterOption { - return func(w *Writer) error { - w.level = levelUncompressed - return nil - } -} - -// WriterBlockSize allows to override the default block size. -// Blocks will be this size or smaller. -// Minimum size is 4KB and and maximum size is 4MB. -// -// Bigger blocks may give bigger throughput on systems with many cores, -// and will increase compression slightly, but it will limit the possible -// concurrency for smaller payloads for both encoding and decoding. -// Default block size is 1MB. -// -// When writing Snappy compatible output using WriterSnappyCompat, -// the maximum block size is 64KB. -func WriterBlockSize(n int) WriterOption { - return func(w *Writer) error { - if w.snappy && n > maxSnappyBlockSize || n < minBlockSize { - return errors.New("s2: block size too large. Must be <= 64K and >=4KB on for snappy compatible output") - } - if n > maxBlockSize || n < minBlockSize { - return errors.New("s2: block size too large. Must be <= 4MB and >=4KB") - } - w.blockSize = n - return nil - } -} - -// WriterPadding will add padding to all output so the size will be a multiple of n. -// This can be used to obfuscate the exact output size or make blocks of a certain size. -// The contents will be a skippable frame, so it will be invisible by the decoder. -// n must be > 0 and <= 4MB. -// The padded area will be filled with data from crypto/rand.Reader. -// The padding will be applied whenever Close is called on the writer. -func WriterPadding(n int) WriterOption { - return func(w *Writer) error { - if n <= 0 { - return fmt.Errorf("s2: padding must be at least 1") - } - // No need to waste our time. - if n == 1 { - w.pad = 0 - } - if n > maxBlockSize { - return fmt.Errorf("s2: padding must less than 4MB") - } - w.pad = n - return nil - } -} - -// WriterPaddingSrc will get random data for padding from the supplied source. -// By default crypto/rand is used. -func WriterPaddingSrc(reader io.Reader) WriterOption { - return func(w *Writer) error { - w.randSrc = reader - return nil - } -} - -// WriterSnappyCompat will write snappy compatible output. -// The output can be decompressed using either snappy or s2. -// If block size is more than 64KB it is set to that. -func WriterSnappyCompat() WriterOption { - return func(w *Writer) error { - w.snappy = true - if w.blockSize > 64<<10 { - // We choose 8 bytes less than 64K, since that will make literal emits slightly more effective. - // And allows us to skip some size checks. - w.blockSize = (64 << 10) - 8 - } - return nil - } -} - -// WriterFlushOnWrite will compress blocks on each call to the Write function. -// -// This is quite inefficient as blocks size will depend on the write size. -// -// Use WriterConcurrency(1) to also make sure that output is flushed. -// When Write calls return, otherwise they will be written when compression is done. -func WriterFlushOnWrite() WriterOption { - return func(w *Writer) error { - w.flushOnWrite = true - return nil - } -} - -// WriterCustomEncoder allows to override the encoder for blocks on the stream. -// The function must compress 'src' into 'dst' and return the bytes used in dst as an integer. -// Block size (initial varint) should not be added by the encoder. -// Returning value 0 indicates the block could not be compressed. -// The function should expect to be called concurrently. -func WriterCustomEncoder(fn func(dst, src []byte) int) WriterOption { - return func(w *Writer) error { - w.customEnc = fn - return nil - } -} diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s index 12a4de3be..9222d179c 100644 --- a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s @@ -52,7 +52,7 @@ search_loop_encodeBlockAsm: SHRL $0x06, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBlockAsm + JAE emit_remainder_encodeBlockAsm MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -90,7 +90,7 @@ search_loop_encodeBlockAsm: repeat_extend_back_loop_encodeBlockAsm: CMPL SI, DI - JLE repeat_extend_back_end_encodeBlockAsm + JBE repeat_extend_back_end_encodeBlockAsm MOVB -1(DX)(BX*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -109,13 +109,13 @@ repeat_extend_back_end_encodeBlockAsm: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeBlockAsm + JB one_byte_repeat_emit_encodeBlockAsm CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeBlockAsm + JB two_bytes_repeat_emit_encodeBlockAsm CMPL BX, $0x00010000 - JLT three_bytes_repeat_emit_encodeBlockAsm + JB three_bytes_repeat_emit_encodeBlockAsm CMPL BX, $0x01000000 - JLT four_bytes_repeat_emit_encodeBlockAsm + JB four_bytes_repeat_emit_encodeBlockAsm MOVB $0xfc, (AX) MOVL BX, 1(AX) ADDQ $0x05, AX @@ -141,7 +141,7 @@ two_bytes_repeat_emit_encodeBlockAsm: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeBlockAsm + JB memmove_repeat_emit_encodeBlockAsm JMP memmove_long_repeat_emit_encodeBlockAsm one_byte_repeat_emit_encodeBlockAsm: @@ -154,7 +154,7 @@ memmove_repeat_emit_encodeBlockAsm: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_repeat_emit_encodeBlockAsm_memmove_move_8through16 CMPQ R8, $0x20 @@ -250,7 +250,7 @@ emit_literal_done_repeat_emit_encodeBlockAsm: // matchLen XORL R11, R11 CMPL R8, $0x08 - JL matchlen_match4_repeat_extend_encodeBlockAsm + JB matchlen_match4_repeat_extend_encodeBlockAsm matchlen_loopback_repeat_extend_encodeBlockAsm: MOVQ (R9)(R11*1), R10 @@ -273,12 +273,12 @@ matchlen_loop_repeat_extend_encodeBlockAsm: LEAL -8(R8), R8 LEAL 8(R11), R11 CMPL R8, $0x08 - JGE matchlen_loopback_repeat_extend_encodeBlockAsm + JAE matchlen_loopback_repeat_extend_encodeBlockAsm JZ repeat_extend_forward_end_encodeBlockAsm matchlen_match4_repeat_extend_encodeBlockAsm: CMPL R8, $0x04 - JL matchlen_match2_repeat_extend_encodeBlockAsm + JB matchlen_match2_repeat_extend_encodeBlockAsm MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm @@ -287,7 +287,7 @@ matchlen_match4_repeat_extend_encodeBlockAsm: matchlen_match2_repeat_extend_encodeBlockAsm: CMPL R8, $0x02 - JL matchlen_match1_repeat_extend_encodeBlockAsm + JB matchlen_match1_repeat_extend_encodeBlockAsm MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm @@ -296,7 +296,7 @@ matchlen_match2_repeat_extend_encodeBlockAsm: matchlen_match1_repeat_extend_encodeBlockAsm: CMPL R8, $0x01 - JL repeat_extend_forward_end_encodeBlockAsm + JB repeat_extend_forward_end_encodeBlockAsm MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm @@ -315,19 +315,19 @@ emit_repeat_again_match_repeat_encodeBlockAsm: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_match_repeat_encodeBlockAsm + JBE repeat_two_match_repeat_encodeBlockAsm CMPL DI, $0x0c - JGE cant_repeat_two_offset_match_repeat_encodeBlockAsm + JAE cant_repeat_two_offset_match_repeat_encodeBlockAsm CMPL SI, $0x00000800 - JLT repeat_two_offset_match_repeat_encodeBlockAsm + JB repeat_two_offset_match_repeat_encodeBlockAsm cant_repeat_two_offset_match_repeat_encodeBlockAsm: CMPL BX, $0x00000104 - JLT repeat_three_match_repeat_encodeBlockAsm + JB repeat_three_match_repeat_encodeBlockAsm CMPL BX, $0x00010100 - JLT repeat_four_match_repeat_encodeBlockAsm + JB repeat_four_match_repeat_encodeBlockAsm CMPL BX, $0x0100ffff - JLT repeat_five_match_repeat_encodeBlockAsm + JB repeat_five_match_repeat_encodeBlockAsm LEAL -16842747(BX), BX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -379,34 +379,34 @@ repeat_two_offset_match_repeat_encodeBlockAsm: repeat_as_copy_encodeBlockAsm: // emitCopy CMPL SI, $0x00010000 - JL two_byte_offset_repeat_as_copy_encodeBlockAsm + JB two_byte_offset_repeat_as_copy_encodeBlockAsm CMPL BX, $0x40 - JLE four_bytes_remain_repeat_as_copy_encodeBlockAsm + JBE four_bytes_remain_repeat_as_copy_encodeBlockAsm MOVB $0xff, (AX) MOVL SI, 1(AX) LEAL -64(BX), BX ADDQ $0x05, AX CMPL BX, $0x04 - JL four_bytes_remain_repeat_as_copy_encodeBlockAsm + JB four_bytes_remain_repeat_as_copy_encodeBlockAsm // emitRepeat emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy + JBE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy + JB repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy CMPL BX, $0x00010100 - JLT repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy + JB repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy CMPL BX, $0x0100ffff - JLT repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy + JB repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy LEAL -16842747(BX), BX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -467,7 +467,7 @@ four_bytes_remain_repeat_as_copy_encodeBlockAsm: two_byte_offset_repeat_as_copy_encodeBlockAsm: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm + JBE two_byte_offset_short_repeat_as_copy_encodeBlockAsm CMPL SI, $0x00000800 JAE long_offset_short_repeat_as_copy_encodeBlockAsm MOVL $0x00000001, DI @@ -489,19 +489,19 @@ emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + JBE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + JB repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b CMPL BX, $0x00010100 - JLT repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + JB repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b CMPL BX, $0x0100ffff - JLT repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b + JB repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short_2b LEAL -16842747(BX), BX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -561,19 +561,19 @@ emit_repeat_again_repeat_as_copy_encodeBlockAsm_emit_copy_short: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short + JBE repeat_two_repeat_as_copy_encodeBlockAsm_emit_copy_short CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm_emit_copy_short: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short + JB repeat_three_repeat_as_copy_encodeBlockAsm_emit_copy_short CMPL BX, $0x00010100 - JLT repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short + JB repeat_four_repeat_as_copy_encodeBlockAsm_emit_copy_short CMPL BX, $0x0100ffff - JLT repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short + JB repeat_five_repeat_as_copy_encodeBlockAsm_emit_copy_short LEAL -16842747(BX), BX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -626,9 +626,9 @@ two_byte_offset_short_repeat_as_copy_encodeBlockAsm: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -679,7 +679,7 @@ candidate_match_encodeBlockAsm: match_extend_back_loop_encodeBlockAsm: CMPL CX, SI - JLE match_extend_back_end_encodeBlockAsm + JBE match_extend_back_end_encodeBlockAsm MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -694,7 +694,7 @@ match_extend_back_end_encodeBlockAsm: SUBL 12(SP), SI LEAQ 5(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBlockAsm + JB match_dst_size_check_encodeBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -709,13 +709,13 @@ match_dst_size_check_encodeBlockAsm: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeBlockAsm + JB one_byte_match_emit_encodeBlockAsm CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeBlockAsm + JB two_bytes_match_emit_encodeBlockAsm CMPL DI, $0x00010000 - JLT three_bytes_match_emit_encodeBlockAsm + JB three_bytes_match_emit_encodeBlockAsm CMPL DI, $0x01000000 - JLT four_bytes_match_emit_encodeBlockAsm + JB four_bytes_match_emit_encodeBlockAsm MOVB $0xfc, (AX) MOVL DI, 1(AX) ADDQ $0x05, AX @@ -741,7 +741,7 @@ two_bytes_match_emit_encodeBlockAsm: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeBlockAsm + JB memmove_match_emit_encodeBlockAsm JMP memmove_long_match_emit_encodeBlockAsm one_byte_match_emit_encodeBlockAsm: @@ -754,7 +754,7 @@ memmove_match_emit_encodeBlockAsm: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeBlockAsm_memmove_move_8through16 CMPQ R8, $0x20 @@ -853,7 +853,7 @@ match_nolit_loop_encodeBlockAsm: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeBlockAsm + JB matchlen_match4_match_nolit_encodeBlockAsm matchlen_loopback_match_nolit_encodeBlockAsm: MOVQ (DI)(R9*1), R8 @@ -876,12 +876,12 @@ matchlen_loop_match_nolit_encodeBlockAsm: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBlockAsm + JAE matchlen_loopback_match_nolit_encodeBlockAsm JZ match_nolit_end_encodeBlockAsm matchlen_match4_match_nolit_encodeBlockAsm: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeBlockAsm + JB matchlen_match2_match_nolit_encodeBlockAsm MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm @@ -890,7 +890,7 @@ matchlen_match4_match_nolit_encodeBlockAsm: matchlen_match2_match_nolit_encodeBlockAsm: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeBlockAsm + JB matchlen_match1_match_nolit_encodeBlockAsm MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm @@ -899,7 +899,7 @@ matchlen_match2_match_nolit_encodeBlockAsm: matchlen_match1_match_nolit_encodeBlockAsm: CMPL SI, $0x01 - JL match_nolit_end_encodeBlockAsm + JB match_nolit_end_encodeBlockAsm MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm @@ -913,34 +913,34 @@ match_nolit_end_encodeBlockAsm: // emitCopy CMPL BX, $0x00010000 - JL two_byte_offset_match_nolit_encodeBlockAsm + JB two_byte_offset_match_nolit_encodeBlockAsm CMPL R9, $0x40 - JLE four_bytes_remain_match_nolit_encodeBlockAsm + JBE four_bytes_remain_match_nolit_encodeBlockAsm MOVB $0xff, (AX) MOVL BX, 1(AX) LEAL -64(R9), R9 ADDQ $0x05, AX CMPL R9, $0x04 - JL four_bytes_remain_match_nolit_encodeBlockAsm + JB four_bytes_remain_match_nolit_encodeBlockAsm // emitRepeat emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm_emit_copy + JBE repeat_two_match_nolit_encodeBlockAsm_emit_copy CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy + JB repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm_emit_copy + JB repeat_three_match_nolit_encodeBlockAsm_emit_copy CMPL R9, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm_emit_copy + JB repeat_four_match_nolit_encodeBlockAsm_emit_copy CMPL R9, $0x0100ffff - JLT repeat_five_match_nolit_encodeBlockAsm_emit_copy + JB repeat_five_match_nolit_encodeBlockAsm_emit_copy LEAL -16842747(R9), R9 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -1001,7 +1001,7 @@ four_bytes_remain_match_nolit_encodeBlockAsm: two_byte_offset_match_nolit_encodeBlockAsm: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBlockAsm + JBE two_byte_offset_short_match_nolit_encodeBlockAsm CMPL BX, $0x00000800 JAE long_offset_short_match_nolit_encodeBlockAsm MOVL $0x00000001, SI @@ -1023,19 +1023,19 @@ emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short_2b: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBlockAsm_emit_copy_short_2b CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short_2b: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBlockAsm_emit_copy_short_2b CMPL R9, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm_emit_copy_short_2b + JB repeat_four_match_nolit_encodeBlockAsm_emit_copy_short_2b CMPL R9, $0x0100ffff - JLT repeat_five_match_nolit_encodeBlockAsm_emit_copy_short_2b + JB repeat_five_match_nolit_encodeBlockAsm_emit_copy_short_2b LEAL -16842747(R9), R9 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -1095,19 +1095,19 @@ emit_repeat_again_match_nolit_encodeBlockAsm_emit_copy_short: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm_emit_copy_short + JBE repeat_two_match_nolit_encodeBlockAsm_emit_copy_short CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBlockAsm_emit_copy_short: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm_emit_copy_short + JB repeat_three_match_nolit_encodeBlockAsm_emit_copy_short CMPL R9, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm_emit_copy_short + JB repeat_four_match_nolit_encodeBlockAsm_emit_copy_short CMPL R9, $0x0100ffff - JLT repeat_five_match_nolit_encodeBlockAsm_emit_copy_short + JB repeat_five_match_nolit_encodeBlockAsm_emit_copy_short LEAL -16842747(R9), R9 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -1160,9 +1160,9 @@ two_byte_offset_short_match_nolit_encodeBlockAsm: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeBlockAsm + JAE emit_copy_three_match_nolit_encodeBlockAsm CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBlockAsm + JAE emit_copy_three_match_nolit_encodeBlockAsm LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -1180,10 +1180,10 @@ emit_copy_three_match_nolit_encodeBlockAsm: match_nolit_emitcopy_end_encodeBlockAsm: CMPL CX, 8(SP) - JGE emit_remainder_encodeBlockAsm + JAE emit_remainder_encodeBlockAsm MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBlockAsm + JB match_nolit_dst_ok_encodeBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -1213,7 +1213,7 @@ emit_remainder_encodeBlockAsm: SUBL 12(SP), CX LEAQ 5(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBlockAsm + JB emit_remainder_ok_encodeBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -1228,13 +1228,13 @@ emit_remainder_ok_encodeBlockAsm: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBlockAsm + JB one_byte_emit_remainder_encodeBlockAsm CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBlockAsm + JB two_bytes_emit_remainder_encodeBlockAsm CMPL DX, $0x00010000 - JLT three_bytes_emit_remainder_encodeBlockAsm + JB three_bytes_emit_remainder_encodeBlockAsm CMPL DX, $0x01000000 - JLT four_bytes_emit_remainder_encodeBlockAsm + JB four_bytes_emit_remainder_encodeBlockAsm MOVB $0xfc, (AX) MOVL DX, 1(AX) ADDQ $0x05, AX @@ -1260,7 +1260,7 @@ two_bytes_emit_remainder_encodeBlockAsm: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBlockAsm + JB memmove_emit_remainder_encodeBlockAsm JMP memmove_long_emit_remainder_encodeBlockAsm one_byte_emit_remainder_encodeBlockAsm: @@ -1423,7 +1423,7 @@ search_loop_encodeBlockAsm4MB: SHRL $0x06, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBlockAsm4MB + JAE emit_remainder_encodeBlockAsm4MB MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -1461,7 +1461,7 @@ search_loop_encodeBlockAsm4MB: repeat_extend_back_loop_encodeBlockAsm4MB: CMPL SI, DI - JLE repeat_extend_back_end_encodeBlockAsm4MB + JBE repeat_extend_back_end_encodeBlockAsm4MB MOVB -1(DX)(BX*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -1480,11 +1480,11 @@ repeat_extend_back_end_encodeBlockAsm4MB: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeBlockAsm4MB + JB one_byte_repeat_emit_encodeBlockAsm4MB CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeBlockAsm4MB + JB two_bytes_repeat_emit_encodeBlockAsm4MB CMPL BX, $0x00010000 - JLT three_bytes_repeat_emit_encodeBlockAsm4MB + JB three_bytes_repeat_emit_encodeBlockAsm4MB MOVL BX, R10 SHRL $0x10, R10 MOVB $0xf8, (AX) @@ -1504,7 +1504,7 @@ two_bytes_repeat_emit_encodeBlockAsm4MB: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeBlockAsm4MB + JB memmove_repeat_emit_encodeBlockAsm4MB JMP memmove_long_repeat_emit_encodeBlockAsm4MB one_byte_repeat_emit_encodeBlockAsm4MB: @@ -1517,7 +1517,7 @@ memmove_repeat_emit_encodeBlockAsm4MB: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_repeat_emit_encodeBlockAsm4MB_memmove_move_8through16 CMPQ R8, $0x20 @@ -1613,7 +1613,7 @@ emit_literal_done_repeat_emit_encodeBlockAsm4MB: // matchLen XORL R11, R11 CMPL R8, $0x08 - JL matchlen_match4_repeat_extend_encodeBlockAsm4MB + JB matchlen_match4_repeat_extend_encodeBlockAsm4MB matchlen_loopback_repeat_extend_encodeBlockAsm4MB: MOVQ (R9)(R11*1), R10 @@ -1636,12 +1636,12 @@ matchlen_loop_repeat_extend_encodeBlockAsm4MB: LEAL -8(R8), R8 LEAL 8(R11), R11 CMPL R8, $0x08 - JGE matchlen_loopback_repeat_extend_encodeBlockAsm4MB + JAE matchlen_loopback_repeat_extend_encodeBlockAsm4MB JZ repeat_extend_forward_end_encodeBlockAsm4MB matchlen_match4_repeat_extend_encodeBlockAsm4MB: CMPL R8, $0x04 - JL matchlen_match2_repeat_extend_encodeBlockAsm4MB + JB matchlen_match2_repeat_extend_encodeBlockAsm4MB MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm4MB @@ -1650,7 +1650,7 @@ matchlen_match4_repeat_extend_encodeBlockAsm4MB: matchlen_match2_repeat_extend_encodeBlockAsm4MB: CMPL R8, $0x02 - JL matchlen_match1_repeat_extend_encodeBlockAsm4MB + JB matchlen_match1_repeat_extend_encodeBlockAsm4MB MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm4MB @@ -1659,7 +1659,7 @@ matchlen_match2_repeat_extend_encodeBlockAsm4MB: matchlen_match1_repeat_extend_encodeBlockAsm4MB: CMPL R8, $0x01 - JL repeat_extend_forward_end_encodeBlockAsm4MB + JB repeat_extend_forward_end_encodeBlockAsm4MB MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm4MB @@ -1677,17 +1677,17 @@ repeat_extend_forward_end_encodeBlockAsm4MB: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_match_repeat_encodeBlockAsm4MB + JBE repeat_two_match_repeat_encodeBlockAsm4MB CMPL DI, $0x0c - JGE cant_repeat_two_offset_match_repeat_encodeBlockAsm4MB + JAE cant_repeat_two_offset_match_repeat_encodeBlockAsm4MB CMPL SI, $0x00000800 - JLT repeat_two_offset_match_repeat_encodeBlockAsm4MB + JB repeat_two_offset_match_repeat_encodeBlockAsm4MB cant_repeat_two_offset_match_repeat_encodeBlockAsm4MB: CMPL BX, $0x00000104 - JLT repeat_three_match_repeat_encodeBlockAsm4MB + JB repeat_three_match_repeat_encodeBlockAsm4MB CMPL BX, $0x00010100 - JLT repeat_four_match_repeat_encodeBlockAsm4MB + JB repeat_four_match_repeat_encodeBlockAsm4MB LEAL -65536(BX), BX MOVL BX, SI MOVW $0x001d, (AX) @@ -1732,31 +1732,31 @@ repeat_two_offset_match_repeat_encodeBlockAsm4MB: repeat_as_copy_encodeBlockAsm4MB: // emitCopy CMPL SI, $0x00010000 - JL two_byte_offset_repeat_as_copy_encodeBlockAsm4MB + JB two_byte_offset_repeat_as_copy_encodeBlockAsm4MB CMPL BX, $0x40 - JLE four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB + JBE four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB MOVB $0xff, (AX) MOVL SI, 1(AX) LEAL -64(BX), BX ADDQ $0x05, AX CMPL BX, $0x04 - JL four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB + JB four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB // emitRepeat MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy + JBE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy + JB repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy CMPL BX, $0x00010100 - JLT repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy + JB repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy LEAL -65536(BX), BX MOVL BX, SI MOVW $0x001d, (AX) @@ -1810,7 +1810,7 @@ four_bytes_remain_repeat_as_copy_encodeBlockAsm4MB: two_byte_offset_repeat_as_copy_encodeBlockAsm4MB: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm4MB + JBE two_byte_offset_short_repeat_as_copy_encodeBlockAsm4MB CMPL SI, $0x00000800 JAE long_offset_short_repeat_as_copy_encodeBlockAsm4MB MOVL $0x00000001, DI @@ -1829,17 +1829,17 @@ two_byte_offset_repeat_as_copy_encodeBlockAsm4MB: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + JBE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + JB repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b CMPL BX, $0x00010100 - JLT repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b + JB repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short_2b LEAL -65536(BX), BX MOVL BX, SI MOVW $0x001d, (AX) @@ -1891,17 +1891,17 @@ long_offset_short_repeat_as_copy_encodeBlockAsm4MB: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + JBE repeat_two_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + JB repeat_three_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short CMPL BX, $0x00010100 - JLT repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short + JB repeat_four_repeat_as_copy_encodeBlockAsm4MB_emit_copy_short LEAL -65536(BX), BX MOVL BX, SI MOVW $0x001d, (AX) @@ -1947,9 +1947,9 @@ two_byte_offset_short_repeat_as_copy_encodeBlockAsm4MB: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm4MB + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm4MB CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm4MB + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm4MB LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -2000,7 +2000,7 @@ candidate_match_encodeBlockAsm4MB: match_extend_back_loop_encodeBlockAsm4MB: CMPL CX, SI - JLE match_extend_back_end_encodeBlockAsm4MB + JBE match_extend_back_end_encodeBlockAsm4MB MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -2015,7 +2015,7 @@ match_extend_back_end_encodeBlockAsm4MB: SUBL 12(SP), SI LEAQ 4(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBlockAsm4MB + JB match_dst_size_check_encodeBlockAsm4MB MOVQ $0x00000000, ret+48(FP) RET @@ -2030,11 +2030,11 @@ match_dst_size_check_encodeBlockAsm4MB: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeBlockAsm4MB + JB one_byte_match_emit_encodeBlockAsm4MB CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeBlockAsm4MB + JB two_bytes_match_emit_encodeBlockAsm4MB CMPL DI, $0x00010000 - JLT three_bytes_match_emit_encodeBlockAsm4MB + JB three_bytes_match_emit_encodeBlockAsm4MB MOVL DI, R9 SHRL $0x10, R9 MOVB $0xf8, (AX) @@ -2054,7 +2054,7 @@ two_bytes_match_emit_encodeBlockAsm4MB: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeBlockAsm4MB + JB memmove_match_emit_encodeBlockAsm4MB JMP memmove_long_match_emit_encodeBlockAsm4MB one_byte_match_emit_encodeBlockAsm4MB: @@ -2067,7 +2067,7 @@ memmove_match_emit_encodeBlockAsm4MB: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeBlockAsm4MB_memmove_move_8through16 CMPQ R8, $0x20 @@ -2166,7 +2166,7 @@ match_nolit_loop_encodeBlockAsm4MB: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeBlockAsm4MB + JB matchlen_match4_match_nolit_encodeBlockAsm4MB matchlen_loopback_match_nolit_encodeBlockAsm4MB: MOVQ (DI)(R9*1), R8 @@ -2189,12 +2189,12 @@ matchlen_loop_match_nolit_encodeBlockAsm4MB: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBlockAsm4MB + JAE matchlen_loopback_match_nolit_encodeBlockAsm4MB JZ match_nolit_end_encodeBlockAsm4MB matchlen_match4_match_nolit_encodeBlockAsm4MB: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeBlockAsm4MB + JB matchlen_match2_match_nolit_encodeBlockAsm4MB MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm4MB @@ -2203,7 +2203,7 @@ matchlen_match4_match_nolit_encodeBlockAsm4MB: matchlen_match2_match_nolit_encodeBlockAsm4MB: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeBlockAsm4MB + JB matchlen_match1_match_nolit_encodeBlockAsm4MB MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm4MB @@ -2212,7 +2212,7 @@ matchlen_match2_match_nolit_encodeBlockAsm4MB: matchlen_match1_match_nolit_encodeBlockAsm4MB: CMPL SI, $0x01 - JL match_nolit_end_encodeBlockAsm4MB + JB match_nolit_end_encodeBlockAsm4MB MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm4MB @@ -2226,31 +2226,31 @@ match_nolit_end_encodeBlockAsm4MB: // emitCopy CMPL BX, $0x00010000 - JL two_byte_offset_match_nolit_encodeBlockAsm4MB + JB two_byte_offset_match_nolit_encodeBlockAsm4MB CMPL R9, $0x40 - JLE four_bytes_remain_match_nolit_encodeBlockAsm4MB + JBE four_bytes_remain_match_nolit_encodeBlockAsm4MB MOVB $0xff, (AX) MOVL BX, 1(AX) LEAL -64(R9), R9 ADDQ $0x05, AX CMPL R9, $0x04 - JL four_bytes_remain_match_nolit_encodeBlockAsm4MB + JB four_bytes_remain_match_nolit_encodeBlockAsm4MB // emitRepeat MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy + JBE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy + JB repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy + JB repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy CMPL R9, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy + JB repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy LEAL -65536(R9), R9 MOVL R9, BX MOVW $0x001d, (AX) @@ -2304,7 +2304,7 @@ four_bytes_remain_match_nolit_encodeBlockAsm4MB: two_byte_offset_match_nolit_encodeBlockAsm4MB: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBlockAsm4MB + JBE two_byte_offset_short_match_nolit_encodeBlockAsm4MB CMPL BX, $0x00000800 JAE long_offset_short_match_nolit_encodeBlockAsm4MB MOVL $0x00000001, SI @@ -2323,17 +2323,17 @@ two_byte_offset_match_nolit_encodeBlockAsm4MB: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b CMPL R9, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b + JB repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short_2b LEAL -65536(R9), R9 MOVL R9, BX MOVW $0x001d, (AX) @@ -2385,17 +2385,17 @@ long_offset_short_match_nolit_encodeBlockAsm4MB: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short + JBE repeat_two_match_nolit_encodeBlockAsm4MB_emit_copy_short CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBlockAsm4MB_emit_copy_short: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short + JB repeat_three_match_nolit_encodeBlockAsm4MB_emit_copy_short CMPL R9, $0x00010100 - JLT repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short + JB repeat_four_match_nolit_encodeBlockAsm4MB_emit_copy_short LEAL -65536(R9), R9 MOVL R9, BX MOVW $0x001d, (AX) @@ -2441,9 +2441,9 @@ two_byte_offset_short_match_nolit_encodeBlockAsm4MB: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeBlockAsm4MB + JAE emit_copy_three_match_nolit_encodeBlockAsm4MB CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBlockAsm4MB + JAE emit_copy_three_match_nolit_encodeBlockAsm4MB LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -2461,10 +2461,10 @@ emit_copy_three_match_nolit_encodeBlockAsm4MB: match_nolit_emitcopy_end_encodeBlockAsm4MB: CMPL CX, 8(SP) - JGE emit_remainder_encodeBlockAsm4MB + JAE emit_remainder_encodeBlockAsm4MB MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBlockAsm4MB + JB match_nolit_dst_ok_encodeBlockAsm4MB MOVQ $0x00000000, ret+48(FP) RET @@ -2494,7 +2494,7 @@ emit_remainder_encodeBlockAsm4MB: SUBL 12(SP), CX LEAQ 4(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBlockAsm4MB + JB emit_remainder_ok_encodeBlockAsm4MB MOVQ $0x00000000, ret+48(FP) RET @@ -2509,11 +2509,11 @@ emit_remainder_ok_encodeBlockAsm4MB: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBlockAsm4MB + JB one_byte_emit_remainder_encodeBlockAsm4MB CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBlockAsm4MB + JB two_bytes_emit_remainder_encodeBlockAsm4MB CMPL DX, $0x00010000 - JLT three_bytes_emit_remainder_encodeBlockAsm4MB + JB three_bytes_emit_remainder_encodeBlockAsm4MB MOVL DX, BX SHRL $0x10, BX MOVB $0xf8, (AX) @@ -2533,7 +2533,7 @@ two_bytes_emit_remainder_encodeBlockAsm4MB: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBlockAsm4MB + JB memmove_emit_remainder_encodeBlockAsm4MB JMP memmove_long_emit_remainder_encodeBlockAsm4MB one_byte_emit_remainder_encodeBlockAsm4MB: @@ -2696,7 +2696,7 @@ search_loop_encodeBlockAsm12B: SHRL $0x05, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBlockAsm12B + JAE emit_remainder_encodeBlockAsm12B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x000000cf1bbcdcbb, R8 @@ -2734,7 +2734,7 @@ search_loop_encodeBlockAsm12B: repeat_extend_back_loop_encodeBlockAsm12B: CMPL SI, DI - JLE repeat_extend_back_end_encodeBlockAsm12B + JBE repeat_extend_back_end_encodeBlockAsm12B MOVB -1(DX)(BX*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -2753,9 +2753,12 @@ repeat_extend_back_end_encodeBlockAsm12B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeBlockAsm12B + JB one_byte_repeat_emit_encodeBlockAsm12B CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeBlockAsm12B + JB two_bytes_repeat_emit_encodeBlockAsm12B + JB three_bytes_repeat_emit_encodeBlockAsm12B + +three_bytes_repeat_emit_encodeBlockAsm12B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -2766,7 +2769,7 @@ two_bytes_repeat_emit_encodeBlockAsm12B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeBlockAsm12B + JB memmove_repeat_emit_encodeBlockAsm12B JMP memmove_long_repeat_emit_encodeBlockAsm12B one_byte_repeat_emit_encodeBlockAsm12B: @@ -2779,7 +2782,7 @@ memmove_repeat_emit_encodeBlockAsm12B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_repeat_emit_encodeBlockAsm12B_memmove_move_8through16 CMPQ R8, $0x20 @@ -2875,7 +2878,7 @@ emit_literal_done_repeat_emit_encodeBlockAsm12B: // matchLen XORL R11, R11 CMPL R8, $0x08 - JL matchlen_match4_repeat_extend_encodeBlockAsm12B + JB matchlen_match4_repeat_extend_encodeBlockAsm12B matchlen_loopback_repeat_extend_encodeBlockAsm12B: MOVQ (R9)(R11*1), R10 @@ -2898,12 +2901,12 @@ matchlen_loop_repeat_extend_encodeBlockAsm12B: LEAL -8(R8), R8 LEAL 8(R11), R11 CMPL R8, $0x08 - JGE matchlen_loopback_repeat_extend_encodeBlockAsm12B + JAE matchlen_loopback_repeat_extend_encodeBlockAsm12B JZ repeat_extend_forward_end_encodeBlockAsm12B matchlen_match4_repeat_extend_encodeBlockAsm12B: CMPL R8, $0x04 - JL matchlen_match2_repeat_extend_encodeBlockAsm12B + JB matchlen_match2_repeat_extend_encodeBlockAsm12B MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm12B @@ -2912,7 +2915,7 @@ matchlen_match4_repeat_extend_encodeBlockAsm12B: matchlen_match2_repeat_extend_encodeBlockAsm12B: CMPL R8, $0x02 - JL matchlen_match1_repeat_extend_encodeBlockAsm12B + JB matchlen_match1_repeat_extend_encodeBlockAsm12B MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm12B @@ -2921,7 +2924,7 @@ matchlen_match2_repeat_extend_encodeBlockAsm12B: matchlen_match1_repeat_extend_encodeBlockAsm12B: CMPL R8, $0x01 - JL repeat_extend_forward_end_encodeBlockAsm12B + JB repeat_extend_forward_end_encodeBlockAsm12B MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm12B @@ -2939,15 +2942,15 @@ repeat_extend_forward_end_encodeBlockAsm12B: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_match_repeat_encodeBlockAsm12B + JBE repeat_two_match_repeat_encodeBlockAsm12B CMPL DI, $0x0c - JGE cant_repeat_two_offset_match_repeat_encodeBlockAsm12B + JAE cant_repeat_two_offset_match_repeat_encodeBlockAsm12B CMPL SI, $0x00000800 - JLT repeat_two_offset_match_repeat_encodeBlockAsm12B + JB repeat_two_offset_match_repeat_encodeBlockAsm12B cant_repeat_two_offset_match_repeat_encodeBlockAsm12B: CMPL BX, $0x00000104 - JLT repeat_three_match_repeat_encodeBlockAsm12B + JB repeat_three_match_repeat_encodeBlockAsm12B LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -2982,7 +2985,7 @@ repeat_two_offset_match_repeat_encodeBlockAsm12B: repeat_as_copy_encodeBlockAsm12B: // emitCopy CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm12B + JBE two_byte_offset_short_repeat_as_copy_encodeBlockAsm12B CMPL SI, $0x00000800 JAE long_offset_short_repeat_as_copy_encodeBlockAsm12B MOVL $0x00000001, DI @@ -3001,15 +3004,15 @@ repeat_as_copy_encodeBlockAsm12B: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + JBE repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b + JB repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short_2b LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -3051,15 +3054,15 @@ long_offset_short_repeat_as_copy_encodeBlockAsm12B: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + JBE repeat_two_repeat_as_copy_encodeBlockAsm12B_emit_copy_short CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm12B_emit_copy_short: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short + JB repeat_three_repeat_as_copy_encodeBlockAsm12B_emit_copy_short LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -3095,9 +3098,9 @@ two_byte_offset_short_repeat_as_copy_encodeBlockAsm12B: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm12B + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm12B CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm12B + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm12B LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -3148,7 +3151,7 @@ candidate_match_encodeBlockAsm12B: match_extend_back_loop_encodeBlockAsm12B: CMPL CX, SI - JLE match_extend_back_end_encodeBlockAsm12B + JBE match_extend_back_end_encodeBlockAsm12B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -3163,7 +3166,7 @@ match_extend_back_end_encodeBlockAsm12B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBlockAsm12B + JB match_dst_size_check_encodeBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -3178,9 +3181,12 @@ match_dst_size_check_encodeBlockAsm12B: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeBlockAsm12B + JB one_byte_match_emit_encodeBlockAsm12B CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeBlockAsm12B + JB two_bytes_match_emit_encodeBlockAsm12B + JB three_bytes_match_emit_encodeBlockAsm12B + +three_bytes_match_emit_encodeBlockAsm12B: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -3191,7 +3197,7 @@ two_bytes_match_emit_encodeBlockAsm12B: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeBlockAsm12B + JB memmove_match_emit_encodeBlockAsm12B JMP memmove_long_match_emit_encodeBlockAsm12B one_byte_match_emit_encodeBlockAsm12B: @@ -3204,7 +3210,7 @@ memmove_match_emit_encodeBlockAsm12B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeBlockAsm12B_memmove_move_8through16 CMPQ R8, $0x20 @@ -3303,7 +3309,7 @@ match_nolit_loop_encodeBlockAsm12B: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeBlockAsm12B + JB matchlen_match4_match_nolit_encodeBlockAsm12B matchlen_loopback_match_nolit_encodeBlockAsm12B: MOVQ (DI)(R9*1), R8 @@ -3326,12 +3332,12 @@ matchlen_loop_match_nolit_encodeBlockAsm12B: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBlockAsm12B + JAE matchlen_loopback_match_nolit_encodeBlockAsm12B JZ match_nolit_end_encodeBlockAsm12B matchlen_match4_match_nolit_encodeBlockAsm12B: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeBlockAsm12B + JB matchlen_match2_match_nolit_encodeBlockAsm12B MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm12B @@ -3340,7 +3346,7 @@ matchlen_match4_match_nolit_encodeBlockAsm12B: matchlen_match2_match_nolit_encodeBlockAsm12B: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeBlockAsm12B + JB matchlen_match1_match_nolit_encodeBlockAsm12B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm12B @@ -3349,7 +3355,7 @@ matchlen_match2_match_nolit_encodeBlockAsm12B: matchlen_match1_match_nolit_encodeBlockAsm12B: CMPL SI, $0x01 - JL match_nolit_end_encodeBlockAsm12B + JB match_nolit_end_encodeBlockAsm12B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm12B @@ -3363,7 +3369,7 @@ match_nolit_end_encodeBlockAsm12B: // emitCopy CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBlockAsm12B + JBE two_byte_offset_short_match_nolit_encodeBlockAsm12B CMPL BX, $0x00000800 JAE long_offset_short_match_nolit_encodeBlockAsm12B MOVL $0x00000001, SI @@ -3382,15 +3388,15 @@ match_nolit_end_encodeBlockAsm12B: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short_2b CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short_2b: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short_2b LEAL -256(R9), R9 MOVW $0x0019, (AX) MOVW R9, 2(AX) @@ -3432,15 +3438,15 @@ long_offset_short_match_nolit_encodeBlockAsm12B: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short + JBE repeat_two_match_nolit_encodeBlockAsm12B_emit_copy_short CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBlockAsm12B_emit_copy_short: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short + JB repeat_three_match_nolit_encodeBlockAsm12B_emit_copy_short LEAL -256(R9), R9 MOVW $0x0019, (AX) MOVW R9, 2(AX) @@ -3476,9 +3482,9 @@ two_byte_offset_short_match_nolit_encodeBlockAsm12B: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeBlockAsm12B + JAE emit_copy_three_match_nolit_encodeBlockAsm12B CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBlockAsm12B + JAE emit_copy_three_match_nolit_encodeBlockAsm12B LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -3496,10 +3502,10 @@ emit_copy_three_match_nolit_encodeBlockAsm12B: match_nolit_emitcopy_end_encodeBlockAsm12B: CMPL CX, 8(SP) - JGE emit_remainder_encodeBlockAsm12B + JAE emit_remainder_encodeBlockAsm12B MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBlockAsm12B + JB match_nolit_dst_ok_encodeBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -3529,7 +3535,7 @@ emit_remainder_encodeBlockAsm12B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBlockAsm12B + JB emit_remainder_ok_encodeBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -3544,9 +3550,12 @@ emit_remainder_ok_encodeBlockAsm12B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBlockAsm12B + JB one_byte_emit_remainder_encodeBlockAsm12B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBlockAsm12B + JB two_bytes_emit_remainder_encodeBlockAsm12B + JB three_bytes_emit_remainder_encodeBlockAsm12B + +three_bytes_emit_remainder_encodeBlockAsm12B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -3557,7 +3566,7 @@ two_bytes_emit_remainder_encodeBlockAsm12B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBlockAsm12B + JB memmove_emit_remainder_encodeBlockAsm12B JMP memmove_long_emit_remainder_encodeBlockAsm12B one_byte_emit_remainder_encodeBlockAsm12B: @@ -3720,7 +3729,7 @@ search_loop_encodeBlockAsm10B: SHRL $0x05, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBlockAsm10B + JAE emit_remainder_encodeBlockAsm10B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x9e3779b1, R8 @@ -3758,7 +3767,7 @@ search_loop_encodeBlockAsm10B: repeat_extend_back_loop_encodeBlockAsm10B: CMPL SI, DI - JLE repeat_extend_back_end_encodeBlockAsm10B + JBE repeat_extend_back_end_encodeBlockAsm10B MOVB -1(DX)(BX*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -3777,9 +3786,12 @@ repeat_extend_back_end_encodeBlockAsm10B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeBlockAsm10B + JB one_byte_repeat_emit_encodeBlockAsm10B CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeBlockAsm10B + JB two_bytes_repeat_emit_encodeBlockAsm10B + JB three_bytes_repeat_emit_encodeBlockAsm10B + +three_bytes_repeat_emit_encodeBlockAsm10B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -3790,7 +3802,7 @@ two_bytes_repeat_emit_encodeBlockAsm10B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeBlockAsm10B + JB memmove_repeat_emit_encodeBlockAsm10B JMP memmove_long_repeat_emit_encodeBlockAsm10B one_byte_repeat_emit_encodeBlockAsm10B: @@ -3803,7 +3815,7 @@ memmove_repeat_emit_encodeBlockAsm10B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_repeat_emit_encodeBlockAsm10B_memmove_move_8through16 CMPQ R8, $0x20 @@ -3899,7 +3911,7 @@ emit_literal_done_repeat_emit_encodeBlockAsm10B: // matchLen XORL R11, R11 CMPL R8, $0x08 - JL matchlen_match4_repeat_extend_encodeBlockAsm10B + JB matchlen_match4_repeat_extend_encodeBlockAsm10B matchlen_loopback_repeat_extend_encodeBlockAsm10B: MOVQ (R9)(R11*1), R10 @@ -3922,12 +3934,12 @@ matchlen_loop_repeat_extend_encodeBlockAsm10B: LEAL -8(R8), R8 LEAL 8(R11), R11 CMPL R8, $0x08 - JGE matchlen_loopback_repeat_extend_encodeBlockAsm10B + JAE matchlen_loopback_repeat_extend_encodeBlockAsm10B JZ repeat_extend_forward_end_encodeBlockAsm10B matchlen_match4_repeat_extend_encodeBlockAsm10B: CMPL R8, $0x04 - JL matchlen_match2_repeat_extend_encodeBlockAsm10B + JB matchlen_match2_repeat_extend_encodeBlockAsm10B MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm10B @@ -3936,7 +3948,7 @@ matchlen_match4_repeat_extend_encodeBlockAsm10B: matchlen_match2_repeat_extend_encodeBlockAsm10B: CMPL R8, $0x02 - JL matchlen_match1_repeat_extend_encodeBlockAsm10B + JB matchlen_match1_repeat_extend_encodeBlockAsm10B MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm10B @@ -3945,7 +3957,7 @@ matchlen_match2_repeat_extend_encodeBlockAsm10B: matchlen_match1_repeat_extend_encodeBlockAsm10B: CMPL R8, $0x01 - JL repeat_extend_forward_end_encodeBlockAsm10B + JB repeat_extend_forward_end_encodeBlockAsm10B MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm10B @@ -3963,15 +3975,15 @@ repeat_extend_forward_end_encodeBlockAsm10B: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_match_repeat_encodeBlockAsm10B + JBE repeat_two_match_repeat_encodeBlockAsm10B CMPL DI, $0x0c - JGE cant_repeat_two_offset_match_repeat_encodeBlockAsm10B + JAE cant_repeat_two_offset_match_repeat_encodeBlockAsm10B CMPL SI, $0x00000800 - JLT repeat_two_offset_match_repeat_encodeBlockAsm10B + JB repeat_two_offset_match_repeat_encodeBlockAsm10B cant_repeat_two_offset_match_repeat_encodeBlockAsm10B: CMPL BX, $0x00000104 - JLT repeat_three_match_repeat_encodeBlockAsm10B + JB repeat_three_match_repeat_encodeBlockAsm10B LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -4006,7 +4018,7 @@ repeat_two_offset_match_repeat_encodeBlockAsm10B: repeat_as_copy_encodeBlockAsm10B: // emitCopy CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm10B + JBE two_byte_offset_short_repeat_as_copy_encodeBlockAsm10B CMPL SI, $0x00000800 JAE long_offset_short_repeat_as_copy_encodeBlockAsm10B MOVL $0x00000001, DI @@ -4025,15 +4037,15 @@ repeat_as_copy_encodeBlockAsm10B: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + JBE repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b + JB repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short_2b LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -4075,15 +4087,15 @@ long_offset_short_repeat_as_copy_encodeBlockAsm10B: MOVL BX, DI LEAL -4(BX), BX CMPL DI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + JBE repeat_two_repeat_as_copy_encodeBlockAsm10B_emit_copy_short CMPL DI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short CMPL SI, $0x00000800 - JLT repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + JB repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm10B_emit_copy_short: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short + JB repeat_three_repeat_as_copy_encodeBlockAsm10B_emit_copy_short LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -4119,9 +4131,9 @@ two_byte_offset_short_repeat_as_copy_encodeBlockAsm10B: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm10B + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm10B CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm10B + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm10B LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -4172,7 +4184,7 @@ candidate_match_encodeBlockAsm10B: match_extend_back_loop_encodeBlockAsm10B: CMPL CX, SI - JLE match_extend_back_end_encodeBlockAsm10B + JBE match_extend_back_end_encodeBlockAsm10B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -4187,7 +4199,7 @@ match_extend_back_end_encodeBlockAsm10B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBlockAsm10B + JB match_dst_size_check_encodeBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -4202,9 +4214,12 @@ match_dst_size_check_encodeBlockAsm10B: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeBlockAsm10B + JB one_byte_match_emit_encodeBlockAsm10B CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeBlockAsm10B + JB two_bytes_match_emit_encodeBlockAsm10B + JB three_bytes_match_emit_encodeBlockAsm10B + +three_bytes_match_emit_encodeBlockAsm10B: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -4215,7 +4230,7 @@ two_bytes_match_emit_encodeBlockAsm10B: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeBlockAsm10B + JB memmove_match_emit_encodeBlockAsm10B JMP memmove_long_match_emit_encodeBlockAsm10B one_byte_match_emit_encodeBlockAsm10B: @@ -4228,7 +4243,7 @@ memmove_match_emit_encodeBlockAsm10B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeBlockAsm10B_memmove_move_8through16 CMPQ R8, $0x20 @@ -4327,7 +4342,7 @@ match_nolit_loop_encodeBlockAsm10B: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeBlockAsm10B + JB matchlen_match4_match_nolit_encodeBlockAsm10B matchlen_loopback_match_nolit_encodeBlockAsm10B: MOVQ (DI)(R9*1), R8 @@ -4350,12 +4365,12 @@ matchlen_loop_match_nolit_encodeBlockAsm10B: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBlockAsm10B + JAE matchlen_loopback_match_nolit_encodeBlockAsm10B JZ match_nolit_end_encodeBlockAsm10B matchlen_match4_match_nolit_encodeBlockAsm10B: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeBlockAsm10B + JB matchlen_match2_match_nolit_encodeBlockAsm10B MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm10B @@ -4364,7 +4379,7 @@ matchlen_match4_match_nolit_encodeBlockAsm10B: matchlen_match2_match_nolit_encodeBlockAsm10B: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeBlockAsm10B + JB matchlen_match1_match_nolit_encodeBlockAsm10B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm10B @@ -4373,7 +4388,7 @@ matchlen_match2_match_nolit_encodeBlockAsm10B: matchlen_match1_match_nolit_encodeBlockAsm10B: CMPL SI, $0x01 - JL match_nolit_end_encodeBlockAsm10B + JB match_nolit_end_encodeBlockAsm10B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm10B @@ -4387,7 +4402,7 @@ match_nolit_end_encodeBlockAsm10B: // emitCopy CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBlockAsm10B + JBE two_byte_offset_short_match_nolit_encodeBlockAsm10B CMPL BX, $0x00000800 JAE long_offset_short_match_nolit_encodeBlockAsm10B MOVL $0x00000001, SI @@ -4406,15 +4421,15 @@ match_nolit_end_encodeBlockAsm10B: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short_2b CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short_2b: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short_2b LEAL -256(R9), R9 MOVW $0x0019, (AX) MOVW R9, 2(AX) @@ -4456,15 +4471,15 @@ long_offset_short_match_nolit_encodeBlockAsm10B: MOVL R9, SI LEAL -4(R9), R9 CMPL SI, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short + JBE repeat_two_match_nolit_encodeBlockAsm10B_emit_copy_short CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short CMPL BX, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBlockAsm10B_emit_copy_short: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short + JB repeat_three_match_nolit_encodeBlockAsm10B_emit_copy_short LEAL -256(R9), R9 MOVW $0x0019, (AX) MOVW R9, 2(AX) @@ -4500,9 +4515,9 @@ two_byte_offset_short_match_nolit_encodeBlockAsm10B: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeBlockAsm10B + JAE emit_copy_three_match_nolit_encodeBlockAsm10B CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBlockAsm10B + JAE emit_copy_three_match_nolit_encodeBlockAsm10B LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -4520,10 +4535,10 @@ emit_copy_three_match_nolit_encodeBlockAsm10B: match_nolit_emitcopy_end_encodeBlockAsm10B: CMPL CX, 8(SP) - JGE emit_remainder_encodeBlockAsm10B + JAE emit_remainder_encodeBlockAsm10B MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBlockAsm10B + JB match_nolit_dst_ok_encodeBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -4553,7 +4568,7 @@ emit_remainder_encodeBlockAsm10B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBlockAsm10B + JB emit_remainder_ok_encodeBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -4568,9 +4583,12 @@ emit_remainder_ok_encodeBlockAsm10B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBlockAsm10B + JB one_byte_emit_remainder_encodeBlockAsm10B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBlockAsm10B + JB two_bytes_emit_remainder_encodeBlockAsm10B + JB three_bytes_emit_remainder_encodeBlockAsm10B + +three_bytes_emit_remainder_encodeBlockAsm10B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -4581,7 +4599,7 @@ two_bytes_emit_remainder_encodeBlockAsm10B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBlockAsm10B + JB memmove_emit_remainder_encodeBlockAsm10B JMP memmove_long_emit_remainder_encodeBlockAsm10B one_byte_emit_remainder_encodeBlockAsm10B: @@ -4744,7 +4762,7 @@ search_loop_encodeBlockAsm8B: SHRL $0x04, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBlockAsm8B + JAE emit_remainder_encodeBlockAsm8B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x9e3779b1, R8 @@ -4782,7 +4800,7 @@ search_loop_encodeBlockAsm8B: repeat_extend_back_loop_encodeBlockAsm8B: CMPL SI, DI - JLE repeat_extend_back_end_encodeBlockAsm8B + JBE repeat_extend_back_end_encodeBlockAsm8B MOVB -1(DX)(BX*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -4801,9 +4819,12 @@ repeat_extend_back_end_encodeBlockAsm8B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeBlockAsm8B + JB one_byte_repeat_emit_encodeBlockAsm8B CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeBlockAsm8B + JB two_bytes_repeat_emit_encodeBlockAsm8B + JB three_bytes_repeat_emit_encodeBlockAsm8B + +three_bytes_repeat_emit_encodeBlockAsm8B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -4814,7 +4835,7 @@ two_bytes_repeat_emit_encodeBlockAsm8B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeBlockAsm8B + JB memmove_repeat_emit_encodeBlockAsm8B JMP memmove_long_repeat_emit_encodeBlockAsm8B one_byte_repeat_emit_encodeBlockAsm8B: @@ -4827,7 +4848,7 @@ memmove_repeat_emit_encodeBlockAsm8B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_repeat_emit_encodeBlockAsm8B_memmove_move_8through16 CMPQ R8, $0x20 @@ -4923,7 +4944,7 @@ emit_literal_done_repeat_emit_encodeBlockAsm8B: // matchLen XORL R11, R11 CMPL R8, $0x08 - JL matchlen_match4_repeat_extend_encodeBlockAsm8B + JB matchlen_match4_repeat_extend_encodeBlockAsm8B matchlen_loopback_repeat_extend_encodeBlockAsm8B: MOVQ (R9)(R11*1), R10 @@ -4946,12 +4967,12 @@ matchlen_loop_repeat_extend_encodeBlockAsm8B: LEAL -8(R8), R8 LEAL 8(R11), R11 CMPL R8, $0x08 - JGE matchlen_loopback_repeat_extend_encodeBlockAsm8B + JAE matchlen_loopback_repeat_extend_encodeBlockAsm8B JZ repeat_extend_forward_end_encodeBlockAsm8B matchlen_match4_repeat_extend_encodeBlockAsm8B: CMPL R8, $0x04 - JL matchlen_match2_repeat_extend_encodeBlockAsm8B + JB matchlen_match2_repeat_extend_encodeBlockAsm8B MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm8B @@ -4960,7 +4981,7 @@ matchlen_match4_repeat_extend_encodeBlockAsm8B: matchlen_match2_repeat_extend_encodeBlockAsm8B: CMPL R8, $0x02 - JL matchlen_match1_repeat_extend_encodeBlockAsm8B + JB matchlen_match1_repeat_extend_encodeBlockAsm8B MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm8B @@ -4969,7 +4990,7 @@ matchlen_match2_repeat_extend_encodeBlockAsm8B: matchlen_match1_repeat_extend_encodeBlockAsm8B: CMPL R8, $0x01 - JL repeat_extend_forward_end_encodeBlockAsm8B + JB repeat_extend_forward_end_encodeBlockAsm8B MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm8B @@ -4987,13 +5008,13 @@ repeat_extend_forward_end_encodeBlockAsm8B: MOVL BX, SI LEAL -4(BX), BX CMPL SI, $0x08 - JLE repeat_two_match_repeat_encodeBlockAsm8B + JBE repeat_two_match_repeat_encodeBlockAsm8B CMPL SI, $0x0c - JGE cant_repeat_two_offset_match_repeat_encodeBlockAsm8B + JAE cant_repeat_two_offset_match_repeat_encodeBlockAsm8B cant_repeat_two_offset_match_repeat_encodeBlockAsm8B: CMPL BX, $0x00000104 - JLT repeat_three_match_repeat_encodeBlockAsm8B + JB repeat_three_match_repeat_encodeBlockAsm8B LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -5026,7 +5047,7 @@ repeat_two_match_repeat_encodeBlockAsm8B: repeat_as_copy_encodeBlockAsm8B: // emitCopy CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeBlockAsm8B + JBE two_byte_offset_short_repeat_as_copy_encodeBlockAsm8B CMPL SI, $0x00000800 JAE long_offset_short_repeat_as_copy_encodeBlockAsm8B MOVL $0x00000001, DI @@ -5045,13 +5066,13 @@ repeat_as_copy_encodeBlockAsm8B: MOVL BX, SI LEAL -4(BX), BX CMPL SI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + JBE repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b CMPL SI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b + JB repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short_2b LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -5091,13 +5112,13 @@ long_offset_short_repeat_as_copy_encodeBlockAsm8B: MOVL BX, SI LEAL -4(BX), BX CMPL SI, $0x08 - JLE repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short + JBE repeat_two_repeat_as_copy_encodeBlockAsm8B_emit_copy_short CMPL SI, $0x0c - JGE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short + JAE cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short cant_repeat_two_offset_repeat_as_copy_encodeBlockAsm8B_emit_copy_short: CMPL BX, $0x00000104 - JLT repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short + JB repeat_three_repeat_as_copy_encodeBlockAsm8B_emit_copy_short LEAL -256(BX), BX MOVW $0x0019, (AX) MOVW BX, 2(AX) @@ -5131,7 +5152,7 @@ two_byte_offset_short_repeat_as_copy_encodeBlockAsm8B: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeBlockAsm8B + JAE emit_copy_three_repeat_as_copy_encodeBlockAsm8B LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -5182,7 +5203,7 @@ candidate_match_encodeBlockAsm8B: match_extend_back_loop_encodeBlockAsm8B: CMPL CX, SI - JLE match_extend_back_end_encodeBlockAsm8B + JBE match_extend_back_end_encodeBlockAsm8B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -5197,7 +5218,7 @@ match_extend_back_end_encodeBlockAsm8B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBlockAsm8B + JB match_dst_size_check_encodeBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -5212,9 +5233,12 @@ match_dst_size_check_encodeBlockAsm8B: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeBlockAsm8B + JB one_byte_match_emit_encodeBlockAsm8B CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeBlockAsm8B + JB two_bytes_match_emit_encodeBlockAsm8B + JB three_bytes_match_emit_encodeBlockAsm8B + +three_bytes_match_emit_encodeBlockAsm8B: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -5225,7 +5249,7 @@ two_bytes_match_emit_encodeBlockAsm8B: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeBlockAsm8B + JB memmove_match_emit_encodeBlockAsm8B JMP memmove_long_match_emit_encodeBlockAsm8B one_byte_match_emit_encodeBlockAsm8B: @@ -5238,7 +5262,7 @@ memmove_match_emit_encodeBlockAsm8B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeBlockAsm8B_memmove_move_8through16 CMPQ R8, $0x20 @@ -5337,7 +5361,7 @@ match_nolit_loop_encodeBlockAsm8B: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeBlockAsm8B + JB matchlen_match4_match_nolit_encodeBlockAsm8B matchlen_loopback_match_nolit_encodeBlockAsm8B: MOVQ (DI)(R9*1), R8 @@ -5360,12 +5384,12 @@ matchlen_loop_match_nolit_encodeBlockAsm8B: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBlockAsm8B + JAE matchlen_loopback_match_nolit_encodeBlockAsm8B JZ match_nolit_end_encodeBlockAsm8B matchlen_match4_match_nolit_encodeBlockAsm8B: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeBlockAsm8B + JB matchlen_match2_match_nolit_encodeBlockAsm8B MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm8B @@ -5374,7 +5398,7 @@ matchlen_match4_match_nolit_encodeBlockAsm8B: matchlen_match2_match_nolit_encodeBlockAsm8B: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeBlockAsm8B + JB matchlen_match1_match_nolit_encodeBlockAsm8B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm8B @@ -5383,7 +5407,7 @@ matchlen_match2_match_nolit_encodeBlockAsm8B: matchlen_match1_match_nolit_encodeBlockAsm8B: CMPL SI, $0x01 - JL match_nolit_end_encodeBlockAsm8B + JB match_nolit_end_encodeBlockAsm8B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm8B @@ -5397,7 +5421,7 @@ match_nolit_end_encodeBlockAsm8B: // emitCopy CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBlockAsm8B + JBE two_byte_offset_short_match_nolit_encodeBlockAsm8B CMPL BX, $0x00000800 JAE long_offset_short_match_nolit_encodeBlockAsm8B MOVL $0x00000001, SI @@ -5416,13 +5440,13 @@ match_nolit_end_encodeBlockAsm8B: MOVL R9, BX LEAL -4(R9), R9 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short_2b CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short_2b: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short_2b LEAL -256(R9), R9 MOVW $0x0019, (AX) MOVW R9, 2(AX) @@ -5462,13 +5486,13 @@ long_offset_short_match_nolit_encodeBlockAsm8B: MOVL R9, BX LEAL -4(R9), R9 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short + JBE repeat_two_match_nolit_encodeBlockAsm8B_emit_copy_short CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBlockAsm8B_emit_copy_short: CMPL R9, $0x00000104 - JLT repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short + JB repeat_three_match_nolit_encodeBlockAsm8B_emit_copy_short LEAL -256(R9), R9 MOVW $0x0019, (AX) MOVW R9, 2(AX) @@ -5502,7 +5526,7 @@ two_byte_offset_short_match_nolit_encodeBlockAsm8B: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeBlockAsm8B + JAE emit_copy_three_match_nolit_encodeBlockAsm8B LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -5520,10 +5544,10 @@ emit_copy_three_match_nolit_encodeBlockAsm8B: match_nolit_emitcopy_end_encodeBlockAsm8B: CMPL CX, 8(SP) - JGE emit_remainder_encodeBlockAsm8B + JAE emit_remainder_encodeBlockAsm8B MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBlockAsm8B + JB match_nolit_dst_ok_encodeBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -5553,7 +5577,7 @@ emit_remainder_encodeBlockAsm8B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBlockAsm8B + JB emit_remainder_ok_encodeBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -5568,9 +5592,12 @@ emit_remainder_ok_encodeBlockAsm8B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBlockAsm8B + JB one_byte_emit_remainder_encodeBlockAsm8B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBlockAsm8B + JB two_bytes_emit_remainder_encodeBlockAsm8B + JB three_bytes_emit_remainder_encodeBlockAsm8B + +three_bytes_emit_remainder_encodeBlockAsm8B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -5581,7 +5608,7 @@ two_bytes_emit_remainder_encodeBlockAsm8B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBlockAsm8B + JB memmove_emit_remainder_encodeBlockAsm8B JMP memmove_long_emit_remainder_encodeBlockAsm8B one_byte_emit_remainder_encodeBlockAsm8B: @@ -5743,7 +5770,7 @@ search_loop_encodeBetterBlockAsm: SUBL 12(SP), BX SHRL $0x07, BX CMPL BX, $0x63 - JLE check_maxskip_ok_encodeBetterBlockAsm + JBE check_maxskip_ok_encodeBetterBlockAsm LEAL 100(CX), BX JMP check_maxskip_cont_encodeBetterBlockAsm @@ -5752,7 +5779,7 @@ check_maxskip_ok_encodeBetterBlockAsm: check_maxskip_cont_encodeBetterBlockAsm: CMPL BX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm + JAE emit_remainder_encodeBetterBlockAsm MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x00cf1bbcdcbfa563, R8 @@ -5807,7 +5834,7 @@ candidate_match_encodeBetterBlockAsm: match_extend_back_loop_encodeBetterBlockAsm: CMPL CX, SI - JLE match_extend_back_end_encodeBetterBlockAsm + JBE match_extend_back_end_encodeBetterBlockAsm MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -5822,7 +5849,7 @@ match_extend_back_end_encodeBetterBlockAsm: SUBL 12(SP), SI LEAQ 5(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBetterBlockAsm + JB match_dst_size_check_encodeBetterBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -5838,7 +5865,7 @@ match_dst_size_check_encodeBetterBlockAsm: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeBetterBlockAsm + JB matchlen_match4_match_nolit_encodeBetterBlockAsm matchlen_loopback_match_nolit_encodeBetterBlockAsm: MOVQ (R8)(R11*1), R10 @@ -5861,12 +5888,12 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBetterBlockAsm + JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm JZ match_nolit_end_encodeBetterBlockAsm matchlen_match4_match_nolit_encodeBetterBlockAsm: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeBetterBlockAsm + JB matchlen_match2_match_nolit_encodeBetterBlockAsm MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm @@ -5875,7 +5902,7 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm: matchlen_match2_match_nolit_encodeBetterBlockAsm: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeBetterBlockAsm + JB matchlen_match1_match_nolit_encodeBetterBlockAsm MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm @@ -5884,7 +5911,7 @@ matchlen_match2_match_nolit_encodeBetterBlockAsm: matchlen_match1_match_nolit_encodeBetterBlockAsm: CMPL DI, $0x01 - JL match_nolit_end_encodeBetterBlockAsm + JB match_nolit_end_encodeBetterBlockAsm MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm @@ -5898,9 +5925,9 @@ match_nolit_end_encodeBetterBlockAsm: CMPL 16(SP), DI JEQ match_is_repeat_encodeBetterBlockAsm CMPL R11, $0x01 - JG match_length_ok_encodeBetterBlockAsm + JA match_length_ok_encodeBetterBlockAsm CMPL DI, $0x0000ffff - JLE match_length_ok_encodeBetterBlockAsm + JBE match_length_ok_encodeBetterBlockAsm MOVL 20(SP), CX INCL CX JMP search_loop_encodeBetterBlockAsm @@ -5916,13 +5943,13 @@ match_length_ok_encodeBetterBlockAsm: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeBetterBlockAsm + JB one_byte_match_emit_encodeBetterBlockAsm CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeBetterBlockAsm + JB two_bytes_match_emit_encodeBetterBlockAsm CMPL BX, $0x00010000 - JLT three_bytes_match_emit_encodeBetterBlockAsm + JB three_bytes_match_emit_encodeBetterBlockAsm CMPL BX, $0x01000000 - JLT four_bytes_match_emit_encodeBetterBlockAsm + JB four_bytes_match_emit_encodeBetterBlockAsm MOVB $0xfc, (AX) MOVL BX, 1(AX) ADDQ $0x05, AX @@ -5948,7 +5975,7 @@ two_bytes_match_emit_encodeBetterBlockAsm: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeBetterBlockAsm + JB memmove_match_emit_encodeBetterBlockAsm JMP memmove_long_match_emit_encodeBetterBlockAsm one_byte_match_emit_encodeBetterBlockAsm: @@ -5961,7 +5988,7 @@ memmove_match_emit_encodeBetterBlockAsm: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4 + JBE emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_encodeBetterBlockAsm_memmove_move_4through7 CMPQ R8, $0x10 @@ -6061,34 +6088,34 @@ emit_literal_done_match_emit_encodeBetterBlockAsm: // emitCopy CMPL DI, $0x00010000 - JL two_byte_offset_match_nolit_encodeBetterBlockAsm + JB two_byte_offset_match_nolit_encodeBetterBlockAsm CMPL R11, $0x40 - JLE four_bytes_remain_match_nolit_encodeBetterBlockAsm + JBE four_bytes_remain_match_nolit_encodeBetterBlockAsm MOVB $0xff, (AX) MOVL DI, 1(AX) LEAL -64(R11), R11 ADDQ $0x05, AX CMPL R11, $0x04 - JL four_bytes_remain_match_nolit_encodeBetterBlockAsm + JB four_bytes_remain_match_nolit_encodeBetterBlockAsm // emitRepeat emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy + JBE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy + JB repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy + JB repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy CMPL R11, $0x0100ffff - JLT repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy + JB repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -6149,7 +6176,7 @@ four_bytes_remain_match_nolit_encodeBetterBlockAsm: two_byte_offset_match_nolit_encodeBetterBlockAsm: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm + JBE two_byte_offset_short_match_nolit_encodeBetterBlockAsm CMPL DI, $0x00000800 JAE long_offset_short_match_nolit_encodeBetterBlockAsm MOVL $0x00000001, BX @@ -6171,19 +6198,19 @@ emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + JB repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b CMPL R11, $0x0100ffff - JLT repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b + JB repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short_2b LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -6243,19 +6270,19 @@ emit_repeat_again_match_nolit_encodeBetterBlockAsm_emit_copy_short: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short + JBE repeat_two_match_nolit_encodeBetterBlockAsm_emit_copy_short CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm_emit_copy_short: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short + JB repeat_three_match_nolit_encodeBetterBlockAsm_emit_copy_short CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short + JB repeat_four_match_nolit_encodeBetterBlockAsm_emit_copy_short CMPL R11, $0x0100ffff - JLT repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short + JB repeat_five_match_nolit_encodeBetterBlockAsm_emit_copy_short LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -6308,9 +6335,9 @@ two_byte_offset_short_match_nolit_encodeBetterBlockAsm: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -6337,13 +6364,13 @@ match_is_repeat_encodeBetterBlockAsm: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_repeat_encodeBetterBlockAsm + JB one_byte_match_emit_repeat_encodeBetterBlockAsm CMPL BX, $0x00000100 - JLT two_bytes_match_emit_repeat_encodeBetterBlockAsm + JB two_bytes_match_emit_repeat_encodeBetterBlockAsm CMPL BX, $0x00010000 - JLT three_bytes_match_emit_repeat_encodeBetterBlockAsm + JB three_bytes_match_emit_repeat_encodeBetterBlockAsm CMPL BX, $0x01000000 - JLT four_bytes_match_emit_repeat_encodeBetterBlockAsm + JB four_bytes_match_emit_repeat_encodeBetterBlockAsm MOVB $0xfc, (AX) MOVL BX, 1(AX) ADDQ $0x05, AX @@ -6369,7 +6396,7 @@ two_bytes_match_emit_repeat_encodeBetterBlockAsm: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_repeat_encodeBetterBlockAsm + JB memmove_match_emit_repeat_encodeBetterBlockAsm JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm one_byte_match_emit_repeat_encodeBetterBlockAsm: @@ -6382,7 +6409,7 @@ memmove_match_emit_repeat_encodeBetterBlockAsm: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4 + JBE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm_memmove_move_4through7 CMPQ R8, $0x10 @@ -6485,19 +6512,19 @@ emit_repeat_again_match_nolit_repeat_encodeBetterBlockAsm: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_repeat_encodeBetterBlockAsm + JBE repeat_two_match_nolit_repeat_encodeBetterBlockAsm CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm + JAE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm + JB repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_repeat_encodeBetterBlockAsm + JB repeat_three_match_nolit_repeat_encodeBetterBlockAsm CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_repeat_encodeBetterBlockAsm + JB repeat_four_match_nolit_repeat_encodeBetterBlockAsm CMPL R11, $0x0100ffff - JLT repeat_five_match_nolit_repeat_encodeBetterBlockAsm + JB repeat_five_match_nolit_repeat_encodeBetterBlockAsm LEAL -16842747(R11), R11 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -6547,9 +6574,9 @@ repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm: match_nolit_emitcopy_end_encodeBetterBlockAsm: CMPL CX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm + JAE emit_remainder_encodeBetterBlockAsm CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBetterBlockAsm + JB match_nolit_dst_ok_encodeBetterBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -6605,7 +6632,7 @@ emit_remainder_encodeBetterBlockAsm: SUBL 12(SP), CX LEAQ 5(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBetterBlockAsm + JB emit_remainder_ok_encodeBetterBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -6620,13 +6647,13 @@ emit_remainder_ok_encodeBetterBlockAsm: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBetterBlockAsm + JB one_byte_emit_remainder_encodeBetterBlockAsm CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBetterBlockAsm + JB two_bytes_emit_remainder_encodeBetterBlockAsm CMPL DX, $0x00010000 - JLT three_bytes_emit_remainder_encodeBetterBlockAsm + JB three_bytes_emit_remainder_encodeBetterBlockAsm CMPL DX, $0x01000000 - JLT four_bytes_emit_remainder_encodeBetterBlockAsm + JB four_bytes_emit_remainder_encodeBetterBlockAsm MOVB $0xfc, (AX) MOVL DX, 1(AX) ADDQ $0x05, AX @@ -6652,7 +6679,7 @@ two_bytes_emit_remainder_encodeBetterBlockAsm: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBetterBlockAsm + JB memmove_emit_remainder_encodeBetterBlockAsm JMP memmove_long_emit_remainder_encodeBetterBlockAsm one_byte_emit_remainder_encodeBetterBlockAsm: @@ -6814,7 +6841,7 @@ search_loop_encodeBetterBlockAsm4MB: SUBL 12(SP), BX SHRL $0x07, BX CMPL BX, $0x63 - JLE check_maxskip_ok_encodeBetterBlockAsm4MB + JBE check_maxskip_ok_encodeBetterBlockAsm4MB LEAL 100(CX), BX JMP check_maxskip_cont_encodeBetterBlockAsm4MB @@ -6823,7 +6850,7 @@ check_maxskip_ok_encodeBetterBlockAsm4MB: check_maxskip_cont_encodeBetterBlockAsm4MB: CMPL BX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm4MB + JAE emit_remainder_encodeBetterBlockAsm4MB MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x00cf1bbcdcbfa563, R8 @@ -6878,7 +6905,7 @@ candidate_match_encodeBetterBlockAsm4MB: match_extend_back_loop_encodeBetterBlockAsm4MB: CMPL CX, SI - JLE match_extend_back_end_encodeBetterBlockAsm4MB + JBE match_extend_back_end_encodeBetterBlockAsm4MB MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -6893,7 +6920,7 @@ match_extend_back_end_encodeBetterBlockAsm4MB: SUBL 12(SP), SI LEAQ 4(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBetterBlockAsm4MB + JB match_dst_size_check_encodeBetterBlockAsm4MB MOVQ $0x00000000, ret+48(FP) RET @@ -6909,7 +6936,7 @@ match_dst_size_check_encodeBetterBlockAsm4MB: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeBetterBlockAsm4MB + JB matchlen_match4_match_nolit_encodeBetterBlockAsm4MB matchlen_loopback_match_nolit_encodeBetterBlockAsm4MB: MOVQ (R8)(R11*1), R10 @@ -6932,12 +6959,12 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm4MB: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBetterBlockAsm4MB + JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm4MB JZ match_nolit_end_encodeBetterBlockAsm4MB matchlen_match4_match_nolit_encodeBetterBlockAsm4MB: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeBetterBlockAsm4MB + JB matchlen_match2_match_nolit_encodeBetterBlockAsm4MB MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm4MB @@ -6946,7 +6973,7 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm4MB: matchlen_match2_match_nolit_encodeBetterBlockAsm4MB: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeBetterBlockAsm4MB + JB matchlen_match1_match_nolit_encodeBetterBlockAsm4MB MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm4MB @@ -6955,7 +6982,7 @@ matchlen_match2_match_nolit_encodeBetterBlockAsm4MB: matchlen_match1_match_nolit_encodeBetterBlockAsm4MB: CMPL DI, $0x01 - JL match_nolit_end_encodeBetterBlockAsm4MB + JB match_nolit_end_encodeBetterBlockAsm4MB MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm4MB @@ -6969,9 +6996,9 @@ match_nolit_end_encodeBetterBlockAsm4MB: CMPL 16(SP), DI JEQ match_is_repeat_encodeBetterBlockAsm4MB CMPL R11, $0x01 - JG match_length_ok_encodeBetterBlockAsm4MB + JA match_length_ok_encodeBetterBlockAsm4MB CMPL DI, $0x0000ffff - JLE match_length_ok_encodeBetterBlockAsm4MB + JBE match_length_ok_encodeBetterBlockAsm4MB MOVL 20(SP), CX INCL CX JMP search_loop_encodeBetterBlockAsm4MB @@ -6987,11 +7014,11 @@ match_length_ok_encodeBetterBlockAsm4MB: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeBetterBlockAsm4MB + JB one_byte_match_emit_encodeBetterBlockAsm4MB CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeBetterBlockAsm4MB + JB two_bytes_match_emit_encodeBetterBlockAsm4MB CMPL BX, $0x00010000 - JLT three_bytes_match_emit_encodeBetterBlockAsm4MB + JB three_bytes_match_emit_encodeBetterBlockAsm4MB MOVL BX, R10 SHRL $0x10, R10 MOVB $0xf8, (AX) @@ -7011,7 +7038,7 @@ two_bytes_match_emit_encodeBetterBlockAsm4MB: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeBetterBlockAsm4MB + JB memmove_match_emit_encodeBetterBlockAsm4MB JMP memmove_long_match_emit_encodeBetterBlockAsm4MB one_byte_match_emit_encodeBetterBlockAsm4MB: @@ -7024,7 +7051,7 @@ memmove_match_emit_encodeBetterBlockAsm4MB: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4 + JBE emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_encodeBetterBlockAsm4MB_memmove_move_4through7 CMPQ R8, $0x10 @@ -7124,31 +7151,31 @@ emit_literal_done_match_emit_encodeBetterBlockAsm4MB: // emitCopy CMPL DI, $0x00010000 - JL two_byte_offset_match_nolit_encodeBetterBlockAsm4MB + JB two_byte_offset_match_nolit_encodeBetterBlockAsm4MB CMPL R11, $0x40 - JLE four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB + JBE four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB MOVB $0xff, (AX) MOVL DI, 1(AX) LEAL -64(R11), R11 ADDQ $0x05, AX CMPL R11, $0x04 - JL four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB + JB four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB // emitRepeat MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy + JBE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy + JB repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy + JB repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy LEAL -65536(R11), R11 MOVL R11, DI MOVW $0x001d, (AX) @@ -7202,7 +7229,7 @@ four_bytes_remain_match_nolit_encodeBetterBlockAsm4MB: two_byte_offset_match_nolit_encodeBetterBlockAsm4MB: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm4MB + JBE two_byte_offset_short_match_nolit_encodeBetterBlockAsm4MB CMPL DI, $0x00000800 JAE long_offset_short_match_nolit_encodeBetterBlockAsm4MB MOVL $0x00000001, BX @@ -7221,17 +7248,17 @@ two_byte_offset_match_nolit_encodeBetterBlockAsm4MB: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b + JB repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short_2b LEAL -65536(R11), R11 MOVL R11, DI MOVW $0x001d, (AX) @@ -7283,17 +7310,17 @@ long_offset_short_match_nolit_encodeBetterBlockAsm4MB: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + JBE repeat_two_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + JB repeat_three_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short + JB repeat_four_match_nolit_encodeBetterBlockAsm4MB_emit_copy_short LEAL -65536(R11), R11 MOVL R11, DI MOVW $0x001d, (AX) @@ -7339,9 +7366,9 @@ two_byte_offset_short_match_nolit_encodeBetterBlockAsm4MB: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm4MB + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm4MB CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm4MB + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm4MB LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -7368,11 +7395,11 @@ match_is_repeat_encodeBetterBlockAsm4MB: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_repeat_encodeBetterBlockAsm4MB + JB one_byte_match_emit_repeat_encodeBetterBlockAsm4MB CMPL BX, $0x00000100 - JLT two_bytes_match_emit_repeat_encodeBetterBlockAsm4MB + JB two_bytes_match_emit_repeat_encodeBetterBlockAsm4MB CMPL BX, $0x00010000 - JLT three_bytes_match_emit_repeat_encodeBetterBlockAsm4MB + JB three_bytes_match_emit_repeat_encodeBetterBlockAsm4MB MOVL BX, R10 SHRL $0x10, R10 MOVB $0xf8, (AX) @@ -7392,7 +7419,7 @@ two_bytes_match_emit_repeat_encodeBetterBlockAsm4MB: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_repeat_encodeBetterBlockAsm4MB + JB memmove_match_emit_repeat_encodeBetterBlockAsm4MB JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm4MB one_byte_match_emit_repeat_encodeBetterBlockAsm4MB: @@ -7405,7 +7432,7 @@ memmove_match_emit_repeat_encodeBetterBlockAsm4MB: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4 + JBE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm4MB_memmove_move_4through7 CMPQ R8, $0x10 @@ -7507,17 +7534,17 @@ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm4MB: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_repeat_encodeBetterBlockAsm4MB + JBE repeat_two_match_nolit_repeat_encodeBetterBlockAsm4MB CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB + JAE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB + JB repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_repeat_encodeBetterBlockAsm4MB + JB repeat_three_match_nolit_repeat_encodeBetterBlockAsm4MB CMPL R11, $0x00010100 - JLT repeat_four_match_nolit_repeat_encodeBetterBlockAsm4MB + JB repeat_four_match_nolit_repeat_encodeBetterBlockAsm4MB LEAL -65536(R11), R11 MOVL R11, DI MOVW $0x001d, (AX) @@ -7560,9 +7587,9 @@ repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm4MB: match_nolit_emitcopy_end_encodeBetterBlockAsm4MB: CMPL CX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm4MB + JAE emit_remainder_encodeBetterBlockAsm4MB CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBetterBlockAsm4MB + JB match_nolit_dst_ok_encodeBetterBlockAsm4MB MOVQ $0x00000000, ret+48(FP) RET @@ -7618,7 +7645,7 @@ emit_remainder_encodeBetterBlockAsm4MB: SUBL 12(SP), CX LEAQ 4(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBetterBlockAsm4MB + JB emit_remainder_ok_encodeBetterBlockAsm4MB MOVQ $0x00000000, ret+48(FP) RET @@ -7633,11 +7660,11 @@ emit_remainder_ok_encodeBetterBlockAsm4MB: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBetterBlockAsm4MB + JB one_byte_emit_remainder_encodeBetterBlockAsm4MB CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBetterBlockAsm4MB + JB two_bytes_emit_remainder_encodeBetterBlockAsm4MB CMPL DX, $0x00010000 - JLT three_bytes_emit_remainder_encodeBetterBlockAsm4MB + JB three_bytes_emit_remainder_encodeBetterBlockAsm4MB MOVL DX, BX SHRL $0x10, BX MOVB $0xf8, (AX) @@ -7657,7 +7684,7 @@ two_bytes_emit_remainder_encodeBetterBlockAsm4MB: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBetterBlockAsm4MB + JB memmove_emit_remainder_encodeBetterBlockAsm4MB JMP memmove_long_emit_remainder_encodeBetterBlockAsm4MB one_byte_emit_remainder_encodeBetterBlockAsm4MB: @@ -7820,7 +7847,7 @@ search_loop_encodeBetterBlockAsm12B: SHRL $0x06, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm12B + JAE emit_remainder_encodeBetterBlockAsm12B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -7875,7 +7902,7 @@ candidate_match_encodeBetterBlockAsm12B: match_extend_back_loop_encodeBetterBlockAsm12B: CMPL CX, SI - JLE match_extend_back_end_encodeBetterBlockAsm12B + JBE match_extend_back_end_encodeBetterBlockAsm12B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -7890,7 +7917,7 @@ match_extend_back_end_encodeBetterBlockAsm12B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBetterBlockAsm12B + JB match_dst_size_check_encodeBetterBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -7906,7 +7933,7 @@ match_dst_size_check_encodeBetterBlockAsm12B: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeBetterBlockAsm12B + JB matchlen_match4_match_nolit_encodeBetterBlockAsm12B matchlen_loopback_match_nolit_encodeBetterBlockAsm12B: MOVQ (R8)(R11*1), R10 @@ -7929,12 +7956,12 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm12B: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBetterBlockAsm12B + JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm12B JZ match_nolit_end_encodeBetterBlockAsm12B matchlen_match4_match_nolit_encodeBetterBlockAsm12B: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeBetterBlockAsm12B + JB matchlen_match2_match_nolit_encodeBetterBlockAsm12B MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm12B @@ -7943,7 +7970,7 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm12B: matchlen_match2_match_nolit_encodeBetterBlockAsm12B: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeBetterBlockAsm12B + JB matchlen_match1_match_nolit_encodeBetterBlockAsm12B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm12B @@ -7952,7 +7979,7 @@ matchlen_match2_match_nolit_encodeBetterBlockAsm12B: matchlen_match1_match_nolit_encodeBetterBlockAsm12B: CMPL DI, $0x01 - JL match_nolit_end_encodeBetterBlockAsm12B + JB match_nolit_end_encodeBetterBlockAsm12B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm12B @@ -7975,9 +8002,12 @@ match_nolit_end_encodeBetterBlockAsm12B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeBetterBlockAsm12B + JB one_byte_match_emit_encodeBetterBlockAsm12B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeBetterBlockAsm12B + JB two_bytes_match_emit_encodeBetterBlockAsm12B + JB three_bytes_match_emit_encodeBetterBlockAsm12B + +three_bytes_match_emit_encodeBetterBlockAsm12B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -7988,7 +8018,7 @@ two_bytes_match_emit_encodeBetterBlockAsm12B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeBetterBlockAsm12B + JB memmove_match_emit_encodeBetterBlockAsm12B JMP memmove_long_match_emit_encodeBetterBlockAsm12B one_byte_match_emit_encodeBetterBlockAsm12B: @@ -8001,7 +8031,7 @@ memmove_match_emit_encodeBetterBlockAsm12B: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4 + JBE emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_encodeBetterBlockAsm12B_memmove_move_4through7 CMPQ R8, $0x10 @@ -8101,7 +8131,7 @@ emit_literal_done_match_emit_encodeBetterBlockAsm12B: // emitCopy CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B + JBE two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B CMPL DI, $0x00000800 JAE long_offset_short_match_nolit_encodeBetterBlockAsm12B MOVL $0x00000001, BX @@ -8120,15 +8150,15 @@ emit_literal_done_match_emit_encodeBetterBlockAsm12B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short_2b LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -8170,15 +8200,15 @@ long_offset_short_match_nolit_encodeBetterBlockAsm12B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + JBE repeat_two_match_nolit_encodeBetterBlockAsm12B_emit_copy_short CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm12B_emit_copy_short: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short + JB repeat_three_match_nolit_encodeBetterBlockAsm12B_emit_copy_short LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -8214,9 +8244,9 @@ two_byte_offset_short_match_nolit_encodeBetterBlockAsm12B: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm12B + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm12B CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm12B + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm12B LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -8243,9 +8273,12 @@ match_is_repeat_encodeBetterBlockAsm12B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_repeat_encodeBetterBlockAsm12B + JB one_byte_match_emit_repeat_encodeBetterBlockAsm12B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_repeat_encodeBetterBlockAsm12B + JB two_bytes_match_emit_repeat_encodeBetterBlockAsm12B + JB three_bytes_match_emit_repeat_encodeBetterBlockAsm12B + +three_bytes_match_emit_repeat_encodeBetterBlockAsm12B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -8256,7 +8289,7 @@ two_bytes_match_emit_repeat_encodeBetterBlockAsm12B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_repeat_encodeBetterBlockAsm12B + JB memmove_match_emit_repeat_encodeBetterBlockAsm12B JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm12B one_byte_match_emit_repeat_encodeBetterBlockAsm12B: @@ -8269,7 +8302,7 @@ memmove_match_emit_repeat_encodeBetterBlockAsm12B: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4 + JBE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm12B_memmove_move_4through7 CMPQ R8, $0x10 @@ -8371,15 +8404,15 @@ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm12B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_repeat_encodeBetterBlockAsm12B + JBE repeat_two_match_nolit_repeat_encodeBetterBlockAsm12B CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B + JAE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B + JB repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_repeat_encodeBetterBlockAsm12B + JB repeat_three_match_nolit_repeat_encodeBetterBlockAsm12B LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -8412,9 +8445,9 @@ repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm12B: match_nolit_emitcopy_end_encodeBetterBlockAsm12B: CMPL CX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm12B + JAE emit_remainder_encodeBetterBlockAsm12B CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBetterBlockAsm12B + JB match_nolit_dst_ok_encodeBetterBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -8470,7 +8503,7 @@ emit_remainder_encodeBetterBlockAsm12B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBetterBlockAsm12B + JB emit_remainder_ok_encodeBetterBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -8485,9 +8518,12 @@ emit_remainder_ok_encodeBetterBlockAsm12B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBetterBlockAsm12B + JB one_byte_emit_remainder_encodeBetterBlockAsm12B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBetterBlockAsm12B + JB two_bytes_emit_remainder_encodeBetterBlockAsm12B + JB three_bytes_emit_remainder_encodeBetterBlockAsm12B + +three_bytes_emit_remainder_encodeBetterBlockAsm12B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -8498,7 +8534,7 @@ two_bytes_emit_remainder_encodeBetterBlockAsm12B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBetterBlockAsm12B + JB memmove_emit_remainder_encodeBetterBlockAsm12B JMP memmove_long_emit_remainder_encodeBetterBlockAsm12B one_byte_emit_remainder_encodeBetterBlockAsm12B: @@ -8661,7 +8697,7 @@ search_loop_encodeBetterBlockAsm10B: SHRL $0x05, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm10B + JAE emit_remainder_encodeBetterBlockAsm10B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -8716,7 +8752,7 @@ candidate_match_encodeBetterBlockAsm10B: match_extend_back_loop_encodeBetterBlockAsm10B: CMPL CX, SI - JLE match_extend_back_end_encodeBetterBlockAsm10B + JBE match_extend_back_end_encodeBetterBlockAsm10B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -8731,7 +8767,7 @@ match_extend_back_end_encodeBetterBlockAsm10B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBetterBlockAsm10B + JB match_dst_size_check_encodeBetterBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -8747,7 +8783,7 @@ match_dst_size_check_encodeBetterBlockAsm10B: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeBetterBlockAsm10B + JB matchlen_match4_match_nolit_encodeBetterBlockAsm10B matchlen_loopback_match_nolit_encodeBetterBlockAsm10B: MOVQ (R8)(R11*1), R10 @@ -8770,12 +8806,12 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm10B: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBetterBlockAsm10B + JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm10B JZ match_nolit_end_encodeBetterBlockAsm10B matchlen_match4_match_nolit_encodeBetterBlockAsm10B: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeBetterBlockAsm10B + JB matchlen_match2_match_nolit_encodeBetterBlockAsm10B MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm10B @@ -8784,7 +8820,7 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm10B: matchlen_match2_match_nolit_encodeBetterBlockAsm10B: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeBetterBlockAsm10B + JB matchlen_match1_match_nolit_encodeBetterBlockAsm10B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm10B @@ -8793,7 +8829,7 @@ matchlen_match2_match_nolit_encodeBetterBlockAsm10B: matchlen_match1_match_nolit_encodeBetterBlockAsm10B: CMPL DI, $0x01 - JL match_nolit_end_encodeBetterBlockAsm10B + JB match_nolit_end_encodeBetterBlockAsm10B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm10B @@ -8816,9 +8852,12 @@ match_nolit_end_encodeBetterBlockAsm10B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeBetterBlockAsm10B + JB one_byte_match_emit_encodeBetterBlockAsm10B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeBetterBlockAsm10B + JB two_bytes_match_emit_encodeBetterBlockAsm10B + JB three_bytes_match_emit_encodeBetterBlockAsm10B + +three_bytes_match_emit_encodeBetterBlockAsm10B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -8829,7 +8868,7 @@ two_bytes_match_emit_encodeBetterBlockAsm10B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeBetterBlockAsm10B + JB memmove_match_emit_encodeBetterBlockAsm10B JMP memmove_long_match_emit_encodeBetterBlockAsm10B one_byte_match_emit_encodeBetterBlockAsm10B: @@ -8842,7 +8881,7 @@ memmove_match_emit_encodeBetterBlockAsm10B: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4 + JBE emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_encodeBetterBlockAsm10B_memmove_move_4through7 CMPQ R8, $0x10 @@ -8942,7 +8981,7 @@ emit_literal_done_match_emit_encodeBetterBlockAsm10B: // emitCopy CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm10B + JBE two_byte_offset_short_match_nolit_encodeBetterBlockAsm10B CMPL DI, $0x00000800 JAE long_offset_short_match_nolit_encodeBetterBlockAsm10B MOVL $0x00000001, BX @@ -8961,15 +9000,15 @@ emit_literal_done_match_emit_encodeBetterBlockAsm10B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short_2b LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -9011,15 +9050,15 @@ long_offset_short_match_nolit_encodeBetterBlockAsm10B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + JBE repeat_two_match_nolit_encodeBetterBlockAsm10B_emit_copy_short CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + JB repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm10B_emit_copy_short: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short + JB repeat_three_match_nolit_encodeBetterBlockAsm10B_emit_copy_short LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -9055,9 +9094,9 @@ two_byte_offset_short_match_nolit_encodeBetterBlockAsm10B: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm10B + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm10B CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm10B + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm10B LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -9084,9 +9123,12 @@ match_is_repeat_encodeBetterBlockAsm10B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_repeat_encodeBetterBlockAsm10B + JB one_byte_match_emit_repeat_encodeBetterBlockAsm10B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_repeat_encodeBetterBlockAsm10B + JB two_bytes_match_emit_repeat_encodeBetterBlockAsm10B + JB three_bytes_match_emit_repeat_encodeBetterBlockAsm10B + +three_bytes_match_emit_repeat_encodeBetterBlockAsm10B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -9097,7 +9139,7 @@ two_bytes_match_emit_repeat_encodeBetterBlockAsm10B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_repeat_encodeBetterBlockAsm10B + JB memmove_match_emit_repeat_encodeBetterBlockAsm10B JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm10B one_byte_match_emit_repeat_encodeBetterBlockAsm10B: @@ -9110,7 +9152,7 @@ memmove_match_emit_repeat_encodeBetterBlockAsm10B: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4 + JBE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm10B_memmove_move_4through7 CMPQ R8, $0x10 @@ -9212,15 +9254,15 @@ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm10B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_repeat_encodeBetterBlockAsm10B + JBE repeat_two_match_nolit_repeat_encodeBetterBlockAsm10B CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B + JAE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B CMPL DI, $0x00000800 - JLT repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B + JB repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_repeat_encodeBetterBlockAsm10B + JB repeat_three_match_nolit_repeat_encodeBetterBlockAsm10B LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -9253,9 +9295,9 @@ repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm10B: match_nolit_emitcopy_end_encodeBetterBlockAsm10B: CMPL CX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm10B + JAE emit_remainder_encodeBetterBlockAsm10B CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBetterBlockAsm10B + JB match_nolit_dst_ok_encodeBetterBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -9311,7 +9353,7 @@ emit_remainder_encodeBetterBlockAsm10B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBetterBlockAsm10B + JB emit_remainder_ok_encodeBetterBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -9326,9 +9368,12 @@ emit_remainder_ok_encodeBetterBlockAsm10B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBetterBlockAsm10B + JB one_byte_emit_remainder_encodeBetterBlockAsm10B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBetterBlockAsm10B + JB two_bytes_emit_remainder_encodeBetterBlockAsm10B + JB three_bytes_emit_remainder_encodeBetterBlockAsm10B + +three_bytes_emit_remainder_encodeBetterBlockAsm10B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -9339,7 +9384,7 @@ two_bytes_emit_remainder_encodeBetterBlockAsm10B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBetterBlockAsm10B + JB memmove_emit_remainder_encodeBetterBlockAsm10B JMP memmove_long_emit_remainder_encodeBetterBlockAsm10B one_byte_emit_remainder_encodeBetterBlockAsm10B: @@ -9502,7 +9547,7 @@ search_loop_encodeBetterBlockAsm8B: SHRL $0x04, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm8B + JAE emit_remainder_encodeBetterBlockAsm8B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -9557,7 +9602,7 @@ candidate_match_encodeBetterBlockAsm8B: match_extend_back_loop_encodeBetterBlockAsm8B: CMPL CX, SI - JLE match_extend_back_end_encodeBetterBlockAsm8B + JBE match_extend_back_end_encodeBetterBlockAsm8B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -9572,7 +9617,7 @@ match_extend_back_end_encodeBetterBlockAsm8B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeBetterBlockAsm8B + JB match_dst_size_check_encodeBetterBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -9588,7 +9633,7 @@ match_dst_size_check_encodeBetterBlockAsm8B: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeBetterBlockAsm8B + JB matchlen_match4_match_nolit_encodeBetterBlockAsm8B matchlen_loopback_match_nolit_encodeBetterBlockAsm8B: MOVQ (R8)(R11*1), R10 @@ -9611,12 +9656,12 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm8B: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeBetterBlockAsm8B + JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm8B JZ match_nolit_end_encodeBetterBlockAsm8B matchlen_match4_match_nolit_encodeBetterBlockAsm8B: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeBetterBlockAsm8B + JB matchlen_match2_match_nolit_encodeBetterBlockAsm8B MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm8B @@ -9625,7 +9670,7 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm8B: matchlen_match2_match_nolit_encodeBetterBlockAsm8B: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeBetterBlockAsm8B + JB matchlen_match1_match_nolit_encodeBetterBlockAsm8B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm8B @@ -9634,7 +9679,7 @@ matchlen_match2_match_nolit_encodeBetterBlockAsm8B: matchlen_match1_match_nolit_encodeBetterBlockAsm8B: CMPL DI, $0x01 - JL match_nolit_end_encodeBetterBlockAsm8B + JB match_nolit_end_encodeBetterBlockAsm8B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm8B @@ -9657,9 +9702,12 @@ match_nolit_end_encodeBetterBlockAsm8B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeBetterBlockAsm8B + JB one_byte_match_emit_encodeBetterBlockAsm8B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeBetterBlockAsm8B + JB two_bytes_match_emit_encodeBetterBlockAsm8B + JB three_bytes_match_emit_encodeBetterBlockAsm8B + +three_bytes_match_emit_encodeBetterBlockAsm8B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -9670,7 +9718,7 @@ two_bytes_match_emit_encodeBetterBlockAsm8B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeBetterBlockAsm8B + JB memmove_match_emit_encodeBetterBlockAsm8B JMP memmove_long_match_emit_encodeBetterBlockAsm8B one_byte_match_emit_encodeBetterBlockAsm8B: @@ -9683,7 +9731,7 @@ memmove_match_emit_encodeBetterBlockAsm8B: // genMemMoveShort CMPQ R8, $0x04 - JLE emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4 + JBE emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4 CMPQ R8, $0x08 JB emit_lit_memmove_match_emit_encodeBetterBlockAsm8B_memmove_move_4through7 CMPQ R8, $0x10 @@ -9783,7 +9831,7 @@ emit_literal_done_match_emit_encodeBetterBlockAsm8B: // emitCopy CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeBetterBlockAsm8B + JBE two_byte_offset_short_match_nolit_encodeBetterBlockAsm8B CMPL DI, $0x00000800 JAE long_offset_short_match_nolit_encodeBetterBlockAsm8B MOVL $0x00000001, BX @@ -9802,13 +9850,13 @@ emit_literal_done_match_emit_encodeBetterBlockAsm8B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + JBE repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b + JB repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short_2b LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -9848,13 +9896,13 @@ long_offset_short_match_nolit_encodeBetterBlockAsm8B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short + JBE repeat_two_match_nolit_encodeBetterBlockAsm8B_emit_copy_short CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short + JAE cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short cant_repeat_two_offset_match_nolit_encodeBetterBlockAsm8B_emit_copy_short: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short + JB repeat_three_match_nolit_encodeBetterBlockAsm8B_emit_copy_short LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -9888,7 +9936,7 @@ two_byte_offset_short_match_nolit_encodeBetterBlockAsm8B: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeBetterBlockAsm8B + JAE emit_copy_three_match_nolit_encodeBetterBlockAsm8B LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -9915,9 +9963,12 @@ match_is_repeat_encodeBetterBlockAsm8B: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_match_emit_repeat_encodeBetterBlockAsm8B + JB one_byte_match_emit_repeat_encodeBetterBlockAsm8B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_repeat_encodeBetterBlockAsm8B + JB two_bytes_match_emit_repeat_encodeBetterBlockAsm8B + JB three_bytes_match_emit_repeat_encodeBetterBlockAsm8B + +three_bytes_match_emit_repeat_encodeBetterBlockAsm8B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -9928,7 +9979,7 @@ two_bytes_match_emit_repeat_encodeBetterBlockAsm8B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_repeat_encodeBetterBlockAsm8B + JB memmove_match_emit_repeat_encodeBetterBlockAsm8B JMP memmove_long_match_emit_repeat_encodeBetterBlockAsm8B one_byte_match_emit_repeat_encodeBetterBlockAsm8B: @@ -9941,7 +9992,7 @@ memmove_match_emit_repeat_encodeBetterBlockAsm8B: // genMemMoveShort CMPQ DI, $0x04 - JLE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4 + JBE emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4 CMPQ DI, $0x08 JB emit_lit_memmove_match_emit_repeat_encodeBetterBlockAsm8B_memmove_move_4through7 CMPQ DI, $0x10 @@ -10043,13 +10094,13 @@ emit_literal_done_match_emit_repeat_encodeBetterBlockAsm8B: MOVL R11, BX LEAL -4(R11), R11 CMPL BX, $0x08 - JLE repeat_two_match_nolit_repeat_encodeBetterBlockAsm8B + JBE repeat_two_match_nolit_repeat_encodeBetterBlockAsm8B CMPL BX, $0x0c - JGE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm8B + JAE cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm8B cant_repeat_two_offset_match_nolit_repeat_encodeBetterBlockAsm8B: CMPL R11, $0x00000104 - JLT repeat_three_match_nolit_repeat_encodeBetterBlockAsm8B + JB repeat_three_match_nolit_repeat_encodeBetterBlockAsm8B LEAL -256(R11), R11 MOVW $0x0019, (AX) MOVW R11, 2(AX) @@ -10080,9 +10131,9 @@ repeat_two_match_nolit_repeat_encodeBetterBlockAsm8B: match_nolit_emitcopy_end_encodeBetterBlockAsm8B: CMPL CX, 8(SP) - JGE emit_remainder_encodeBetterBlockAsm8B + JAE emit_remainder_encodeBetterBlockAsm8B CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeBetterBlockAsm8B + JB match_nolit_dst_ok_encodeBetterBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -10138,7 +10189,7 @@ emit_remainder_encodeBetterBlockAsm8B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeBetterBlockAsm8B + JB emit_remainder_ok_encodeBetterBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -10153,9 +10204,12 @@ emit_remainder_ok_encodeBetterBlockAsm8B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeBetterBlockAsm8B + JB one_byte_emit_remainder_encodeBetterBlockAsm8B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeBetterBlockAsm8B + JB two_bytes_emit_remainder_encodeBetterBlockAsm8B + JB three_bytes_emit_remainder_encodeBetterBlockAsm8B + +three_bytes_emit_remainder_encodeBetterBlockAsm8B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -10166,7 +10220,7 @@ two_bytes_emit_remainder_encodeBetterBlockAsm8B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeBetterBlockAsm8B + JB memmove_emit_remainder_encodeBetterBlockAsm8B JMP memmove_long_emit_remainder_encodeBetterBlockAsm8B one_byte_emit_remainder_encodeBetterBlockAsm8B: @@ -10329,7 +10383,7 @@ search_loop_encodeSnappyBlockAsm: SHRL $0x06, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm + JAE emit_remainder_encodeSnappyBlockAsm MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -10367,7 +10421,7 @@ search_loop_encodeSnappyBlockAsm: repeat_extend_back_loop_encodeSnappyBlockAsm: CMPL SI, BX - JLE repeat_extend_back_end_encodeSnappyBlockAsm + JBE repeat_extend_back_end_encodeSnappyBlockAsm MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -10386,13 +10440,13 @@ repeat_extend_back_end_encodeSnappyBlockAsm: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeSnappyBlockAsm + JB one_byte_repeat_emit_encodeSnappyBlockAsm CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeSnappyBlockAsm + JB two_bytes_repeat_emit_encodeSnappyBlockAsm CMPL BX, $0x00010000 - JLT three_bytes_repeat_emit_encodeSnappyBlockAsm + JB three_bytes_repeat_emit_encodeSnappyBlockAsm CMPL BX, $0x01000000 - JLT four_bytes_repeat_emit_encodeSnappyBlockAsm + JB four_bytes_repeat_emit_encodeSnappyBlockAsm MOVB $0xfc, (AX) MOVL BX, 1(AX) ADDQ $0x05, AX @@ -10418,7 +10472,7 @@ two_bytes_repeat_emit_encodeSnappyBlockAsm: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeSnappyBlockAsm + JB memmove_repeat_emit_encodeSnappyBlockAsm JMP memmove_long_repeat_emit_encodeSnappyBlockAsm one_byte_repeat_emit_encodeSnappyBlockAsm: @@ -10431,7 +10485,7 @@ memmove_repeat_emit_encodeSnappyBlockAsm: // genMemMoveShort CMPQ DI, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8 CMPQ DI, $0x10 JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm_memmove_move_8through16 CMPQ DI, $0x20 @@ -10527,7 +10581,7 @@ emit_literal_done_repeat_emit_encodeSnappyBlockAsm: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_encodeSnappyBlockAsm + JB matchlen_match4_repeat_extend_encodeSnappyBlockAsm matchlen_loopback_repeat_extend_encodeSnappyBlockAsm: MOVQ (R8)(R10*1), R9 @@ -10550,12 +10604,12 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm + JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm JZ repeat_extend_forward_end_encodeSnappyBlockAsm matchlen_match4_repeat_extend_encodeSnappyBlockAsm: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_encodeSnappyBlockAsm + JB matchlen_match2_repeat_extend_encodeSnappyBlockAsm MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm @@ -10564,7 +10618,7 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm: matchlen_match2_repeat_extend_encodeSnappyBlockAsm: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_encodeSnappyBlockAsm + JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm @@ -10573,7 +10627,7 @@ matchlen_match2_repeat_extend_encodeSnappyBlockAsm: matchlen_match1_repeat_extend_encodeSnappyBlockAsm: CMPL DI, $0x01 - JL repeat_extend_forward_end_encodeSnappyBlockAsm + JB repeat_extend_forward_end_encodeSnappyBlockAsm MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm @@ -10587,17 +10641,17 @@ repeat_extend_forward_end_encodeSnappyBlockAsm: // emitCopy CMPL SI, $0x00010000 - JL two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm + JB two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm four_bytes_loop_back_repeat_as_copy_encodeSnappyBlockAsm: CMPL BX, $0x40 - JLE four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm + JBE four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm MOVB $0xff, (AX) MOVL SI, 1(AX) LEAL -64(BX), BX ADDQ $0x05, AX CMPL BX, $0x04 - JL four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm + JB four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm JMP four_bytes_loop_back_repeat_as_copy_encodeSnappyBlockAsm four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm: @@ -10612,7 +10666,7 @@ four_bytes_remain_repeat_as_copy_encodeSnappyBlockAsm: two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm + JBE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(BX), BX @@ -10623,9 +10677,9 @@ two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -10676,7 +10730,7 @@ candidate_match_encodeSnappyBlockAsm: match_extend_back_loop_encodeSnappyBlockAsm: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBlockAsm + JBE match_extend_back_end_encodeSnappyBlockAsm MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -10691,7 +10745,7 @@ match_extend_back_end_encodeSnappyBlockAsm: SUBL 12(SP), SI LEAQ 5(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBlockAsm + JB match_dst_size_check_encodeSnappyBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -10706,13 +10760,13 @@ match_dst_size_check_encodeSnappyBlockAsm: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeSnappyBlockAsm + JB one_byte_match_emit_encodeSnappyBlockAsm CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBlockAsm + JB two_bytes_match_emit_encodeSnappyBlockAsm CMPL DI, $0x00010000 - JLT three_bytes_match_emit_encodeSnappyBlockAsm + JB three_bytes_match_emit_encodeSnappyBlockAsm CMPL DI, $0x01000000 - JLT four_bytes_match_emit_encodeSnappyBlockAsm + JB four_bytes_match_emit_encodeSnappyBlockAsm MOVB $0xfc, (AX) MOVL DI, 1(AX) ADDQ $0x05, AX @@ -10738,7 +10792,7 @@ two_bytes_match_emit_encodeSnappyBlockAsm: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeSnappyBlockAsm + JB memmove_match_emit_encodeSnappyBlockAsm JMP memmove_long_match_emit_encodeSnappyBlockAsm one_byte_match_emit_encodeSnappyBlockAsm: @@ -10751,7 +10805,7 @@ memmove_match_emit_encodeSnappyBlockAsm: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm_memmove_move_8through16 CMPQ R8, $0x20 @@ -10850,7 +10904,7 @@ match_nolit_loop_encodeSnappyBlockAsm: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBlockAsm + JB matchlen_match4_match_nolit_encodeSnappyBlockAsm matchlen_loopback_match_nolit_encodeSnappyBlockAsm: MOVQ (DI)(R9*1), R8 @@ -10873,12 +10927,12 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBlockAsm + JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm JZ match_nolit_end_encodeSnappyBlockAsm matchlen_match4_match_nolit_encodeSnappyBlockAsm: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBlockAsm + JB matchlen_match2_match_nolit_encodeSnappyBlockAsm MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm @@ -10887,7 +10941,7 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm: matchlen_match2_match_nolit_encodeSnappyBlockAsm: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBlockAsm + JB matchlen_match1_match_nolit_encodeSnappyBlockAsm MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm @@ -10896,7 +10950,7 @@ matchlen_match2_match_nolit_encodeSnappyBlockAsm: matchlen_match1_match_nolit_encodeSnappyBlockAsm: CMPL SI, $0x01 - JL match_nolit_end_encodeSnappyBlockAsm + JB match_nolit_end_encodeSnappyBlockAsm MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm @@ -10910,17 +10964,17 @@ match_nolit_end_encodeSnappyBlockAsm: // emitCopy CMPL BX, $0x00010000 - JL two_byte_offset_match_nolit_encodeSnappyBlockAsm + JB two_byte_offset_match_nolit_encodeSnappyBlockAsm four_bytes_loop_back_match_nolit_encodeSnappyBlockAsm: CMPL R9, $0x40 - JLE four_bytes_remain_match_nolit_encodeSnappyBlockAsm + JBE four_bytes_remain_match_nolit_encodeSnappyBlockAsm MOVB $0xff, (AX) MOVL BX, 1(AX) LEAL -64(R9), R9 ADDQ $0x05, AX CMPL R9, $0x04 - JL four_bytes_remain_match_nolit_encodeSnappyBlockAsm + JB four_bytes_remain_match_nolit_encodeSnappyBlockAsm JMP four_bytes_loop_back_match_nolit_encodeSnappyBlockAsm four_bytes_remain_match_nolit_encodeSnappyBlockAsm: @@ -10935,7 +10989,7 @@ four_bytes_remain_match_nolit_encodeSnappyBlockAsm: two_byte_offset_match_nolit_encodeSnappyBlockAsm: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm + JBE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm MOVB $0xee, (AX) MOVW BX, 1(AX) LEAL -60(R9), R9 @@ -10946,9 +11000,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBlockAsm: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -10966,10 +11020,10 @@ emit_copy_three_match_nolit_encodeSnappyBlockAsm: match_nolit_emitcopy_end_encodeSnappyBlockAsm: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm + JAE emit_remainder_encodeSnappyBlockAsm MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBlockAsm + JB match_nolit_dst_ok_encodeSnappyBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -10999,7 +11053,7 @@ emit_remainder_encodeSnappyBlockAsm: SUBL 12(SP), CX LEAQ 5(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBlockAsm + JB emit_remainder_ok_encodeSnappyBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -11014,13 +11068,13 @@ emit_remainder_ok_encodeSnappyBlockAsm: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBlockAsm + JB one_byte_emit_remainder_encodeSnappyBlockAsm CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBlockAsm + JB two_bytes_emit_remainder_encodeSnappyBlockAsm CMPL DX, $0x00010000 - JLT three_bytes_emit_remainder_encodeSnappyBlockAsm + JB three_bytes_emit_remainder_encodeSnappyBlockAsm CMPL DX, $0x01000000 - JLT four_bytes_emit_remainder_encodeSnappyBlockAsm + JB four_bytes_emit_remainder_encodeSnappyBlockAsm MOVB $0xfc, (AX) MOVL DX, 1(AX) ADDQ $0x05, AX @@ -11046,7 +11100,7 @@ two_bytes_emit_remainder_encodeSnappyBlockAsm: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBlockAsm + JB memmove_emit_remainder_encodeSnappyBlockAsm JMP memmove_long_emit_remainder_encodeSnappyBlockAsm one_byte_emit_remainder_encodeSnappyBlockAsm: @@ -11209,7 +11263,7 @@ search_loop_encodeSnappyBlockAsm64K: SHRL $0x06, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm64K + JAE emit_remainder_encodeSnappyBlockAsm64K MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -11247,7 +11301,7 @@ search_loop_encodeSnappyBlockAsm64K: repeat_extend_back_loop_encodeSnappyBlockAsm64K: CMPL SI, BX - JLE repeat_extend_back_end_encodeSnappyBlockAsm64K + JBE repeat_extend_back_end_encodeSnappyBlockAsm64K MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -11266,9 +11320,12 @@ repeat_extend_back_end_encodeSnappyBlockAsm64K: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeSnappyBlockAsm64K + JB one_byte_repeat_emit_encodeSnappyBlockAsm64K CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeSnappyBlockAsm64K + JB two_bytes_repeat_emit_encodeSnappyBlockAsm64K + JB three_bytes_repeat_emit_encodeSnappyBlockAsm64K + +three_bytes_repeat_emit_encodeSnappyBlockAsm64K: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -11279,7 +11336,7 @@ two_bytes_repeat_emit_encodeSnappyBlockAsm64K: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeSnappyBlockAsm64K + JB memmove_repeat_emit_encodeSnappyBlockAsm64K JMP memmove_long_repeat_emit_encodeSnappyBlockAsm64K one_byte_repeat_emit_encodeSnappyBlockAsm64K: @@ -11292,7 +11349,7 @@ memmove_repeat_emit_encodeSnappyBlockAsm64K: // genMemMoveShort CMPQ DI, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8 CMPQ DI, $0x10 JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm64K_memmove_move_8through16 CMPQ DI, $0x20 @@ -11388,7 +11445,7 @@ emit_literal_done_repeat_emit_encodeSnappyBlockAsm64K: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K + JB matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K matchlen_loopback_repeat_extend_encodeSnappyBlockAsm64K: MOVQ (R8)(R10*1), R9 @@ -11411,12 +11468,12 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm64K: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm64K + JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm64K JZ repeat_extend_forward_end_encodeSnappyBlockAsm64K matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K + JB matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K @@ -11425,7 +11482,7 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K: matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K + JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K @@ -11434,7 +11491,7 @@ matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K: matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K: CMPL DI, $0x01 - JL repeat_extend_forward_end_encodeSnappyBlockAsm64K + JB repeat_extend_forward_end_encodeSnappyBlockAsm64K MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm64K @@ -11449,7 +11506,7 @@ repeat_extend_forward_end_encodeSnappyBlockAsm64K: // emitCopy two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm64K: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm64K + JBE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm64K MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(BX), BX @@ -11460,9 +11517,9 @@ two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm64K: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm64K LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -11513,7 +11570,7 @@ candidate_match_encodeSnappyBlockAsm64K: match_extend_back_loop_encodeSnappyBlockAsm64K: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBlockAsm64K + JBE match_extend_back_end_encodeSnappyBlockAsm64K MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -11528,7 +11585,7 @@ match_extend_back_end_encodeSnappyBlockAsm64K: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBlockAsm64K + JB match_dst_size_check_encodeSnappyBlockAsm64K MOVQ $0x00000000, ret+48(FP) RET @@ -11543,9 +11600,12 @@ match_dst_size_check_encodeSnappyBlockAsm64K: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeSnappyBlockAsm64K + JB one_byte_match_emit_encodeSnappyBlockAsm64K CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBlockAsm64K + JB two_bytes_match_emit_encodeSnappyBlockAsm64K + JB three_bytes_match_emit_encodeSnappyBlockAsm64K + +three_bytes_match_emit_encodeSnappyBlockAsm64K: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -11556,7 +11616,7 @@ two_bytes_match_emit_encodeSnappyBlockAsm64K: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeSnappyBlockAsm64K + JB memmove_match_emit_encodeSnappyBlockAsm64K JMP memmove_long_match_emit_encodeSnappyBlockAsm64K one_byte_match_emit_encodeSnappyBlockAsm64K: @@ -11569,7 +11629,7 @@ memmove_match_emit_encodeSnappyBlockAsm64K: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm64K_memmove_move_8through16 CMPQ R8, $0x20 @@ -11668,7 +11728,7 @@ match_nolit_loop_encodeSnappyBlockAsm64K: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBlockAsm64K + JB matchlen_match4_match_nolit_encodeSnappyBlockAsm64K matchlen_loopback_match_nolit_encodeSnappyBlockAsm64K: MOVQ (DI)(R9*1), R8 @@ -11691,12 +11751,12 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm64K: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBlockAsm64K + JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm64K JZ match_nolit_end_encodeSnappyBlockAsm64K matchlen_match4_match_nolit_encodeSnappyBlockAsm64K: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBlockAsm64K + JB matchlen_match2_match_nolit_encodeSnappyBlockAsm64K MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm64K @@ -11705,7 +11765,7 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm64K: matchlen_match2_match_nolit_encodeSnappyBlockAsm64K: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBlockAsm64K + JB matchlen_match1_match_nolit_encodeSnappyBlockAsm64K MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm64K @@ -11714,7 +11774,7 @@ matchlen_match2_match_nolit_encodeSnappyBlockAsm64K: matchlen_match1_match_nolit_encodeSnappyBlockAsm64K: CMPL SI, $0x01 - JL match_nolit_end_encodeSnappyBlockAsm64K + JB match_nolit_end_encodeSnappyBlockAsm64K MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm64K @@ -11729,7 +11789,7 @@ match_nolit_end_encodeSnappyBlockAsm64K: // emitCopy two_byte_offset_match_nolit_encodeSnappyBlockAsm64K: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm64K + JBE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm64K MOVB $0xee, (AX) MOVW BX, 1(AX) LEAL -60(R9), R9 @@ -11740,9 +11800,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBlockAsm64K: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm64K + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm64K CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm64K + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm64K LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -11760,10 +11820,10 @@ emit_copy_three_match_nolit_encodeSnappyBlockAsm64K: match_nolit_emitcopy_end_encodeSnappyBlockAsm64K: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm64K + JAE emit_remainder_encodeSnappyBlockAsm64K MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBlockAsm64K + JB match_nolit_dst_ok_encodeSnappyBlockAsm64K MOVQ $0x00000000, ret+48(FP) RET @@ -11793,7 +11853,7 @@ emit_remainder_encodeSnappyBlockAsm64K: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBlockAsm64K + JB emit_remainder_ok_encodeSnappyBlockAsm64K MOVQ $0x00000000, ret+48(FP) RET @@ -11808,9 +11868,12 @@ emit_remainder_ok_encodeSnappyBlockAsm64K: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBlockAsm64K + JB one_byte_emit_remainder_encodeSnappyBlockAsm64K CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBlockAsm64K + JB two_bytes_emit_remainder_encodeSnappyBlockAsm64K + JB three_bytes_emit_remainder_encodeSnappyBlockAsm64K + +three_bytes_emit_remainder_encodeSnappyBlockAsm64K: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -11821,7 +11884,7 @@ two_bytes_emit_remainder_encodeSnappyBlockAsm64K: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBlockAsm64K + JB memmove_emit_remainder_encodeSnappyBlockAsm64K JMP memmove_long_emit_remainder_encodeSnappyBlockAsm64K one_byte_emit_remainder_encodeSnappyBlockAsm64K: @@ -11984,7 +12047,7 @@ search_loop_encodeSnappyBlockAsm12B: SHRL $0x05, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm12B + JAE emit_remainder_encodeSnappyBlockAsm12B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x000000cf1bbcdcbb, R8 @@ -12022,7 +12085,7 @@ search_loop_encodeSnappyBlockAsm12B: repeat_extend_back_loop_encodeSnappyBlockAsm12B: CMPL SI, BX - JLE repeat_extend_back_end_encodeSnappyBlockAsm12B + JBE repeat_extend_back_end_encodeSnappyBlockAsm12B MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -12041,9 +12104,12 @@ repeat_extend_back_end_encodeSnappyBlockAsm12B: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeSnappyBlockAsm12B + JB one_byte_repeat_emit_encodeSnappyBlockAsm12B CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeSnappyBlockAsm12B + JB two_bytes_repeat_emit_encodeSnappyBlockAsm12B + JB three_bytes_repeat_emit_encodeSnappyBlockAsm12B + +three_bytes_repeat_emit_encodeSnappyBlockAsm12B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -12054,7 +12120,7 @@ two_bytes_repeat_emit_encodeSnappyBlockAsm12B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeSnappyBlockAsm12B + JB memmove_repeat_emit_encodeSnappyBlockAsm12B JMP memmove_long_repeat_emit_encodeSnappyBlockAsm12B one_byte_repeat_emit_encodeSnappyBlockAsm12B: @@ -12067,7 +12133,7 @@ memmove_repeat_emit_encodeSnappyBlockAsm12B: // genMemMoveShort CMPQ DI, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8 CMPQ DI, $0x10 JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm12B_memmove_move_8through16 CMPQ DI, $0x20 @@ -12163,7 +12229,7 @@ emit_literal_done_repeat_emit_encodeSnappyBlockAsm12B: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B + JB matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B matchlen_loopback_repeat_extend_encodeSnappyBlockAsm12B: MOVQ (R8)(R10*1), R9 @@ -12186,12 +12252,12 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm12B: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm12B + JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm12B JZ repeat_extend_forward_end_encodeSnappyBlockAsm12B matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B + JB matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B @@ -12200,7 +12266,7 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B: matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B + JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B @@ -12209,7 +12275,7 @@ matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B: matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B: CMPL DI, $0x01 - JL repeat_extend_forward_end_encodeSnappyBlockAsm12B + JB repeat_extend_forward_end_encodeSnappyBlockAsm12B MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm12B @@ -12224,7 +12290,7 @@ repeat_extend_forward_end_encodeSnappyBlockAsm12B: // emitCopy two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm12B: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm12B + JBE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm12B MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(BX), BX @@ -12235,9 +12301,9 @@ two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm12B: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm12B LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -12288,7 +12354,7 @@ candidate_match_encodeSnappyBlockAsm12B: match_extend_back_loop_encodeSnappyBlockAsm12B: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBlockAsm12B + JBE match_extend_back_end_encodeSnappyBlockAsm12B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -12303,7 +12369,7 @@ match_extend_back_end_encodeSnappyBlockAsm12B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBlockAsm12B + JB match_dst_size_check_encodeSnappyBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -12318,9 +12384,12 @@ match_dst_size_check_encodeSnappyBlockAsm12B: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeSnappyBlockAsm12B + JB one_byte_match_emit_encodeSnappyBlockAsm12B CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBlockAsm12B + JB two_bytes_match_emit_encodeSnappyBlockAsm12B + JB three_bytes_match_emit_encodeSnappyBlockAsm12B + +three_bytes_match_emit_encodeSnappyBlockAsm12B: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -12331,7 +12400,7 @@ two_bytes_match_emit_encodeSnappyBlockAsm12B: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeSnappyBlockAsm12B + JB memmove_match_emit_encodeSnappyBlockAsm12B JMP memmove_long_match_emit_encodeSnappyBlockAsm12B one_byte_match_emit_encodeSnappyBlockAsm12B: @@ -12344,7 +12413,7 @@ memmove_match_emit_encodeSnappyBlockAsm12B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm12B_memmove_move_8through16 CMPQ R8, $0x20 @@ -12443,7 +12512,7 @@ match_nolit_loop_encodeSnappyBlockAsm12B: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBlockAsm12B + JB matchlen_match4_match_nolit_encodeSnappyBlockAsm12B matchlen_loopback_match_nolit_encodeSnappyBlockAsm12B: MOVQ (DI)(R9*1), R8 @@ -12466,12 +12535,12 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm12B: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBlockAsm12B + JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm12B JZ match_nolit_end_encodeSnappyBlockAsm12B matchlen_match4_match_nolit_encodeSnappyBlockAsm12B: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBlockAsm12B + JB matchlen_match2_match_nolit_encodeSnappyBlockAsm12B MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm12B @@ -12480,7 +12549,7 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm12B: matchlen_match2_match_nolit_encodeSnappyBlockAsm12B: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBlockAsm12B + JB matchlen_match1_match_nolit_encodeSnappyBlockAsm12B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm12B @@ -12489,7 +12558,7 @@ matchlen_match2_match_nolit_encodeSnappyBlockAsm12B: matchlen_match1_match_nolit_encodeSnappyBlockAsm12B: CMPL SI, $0x01 - JL match_nolit_end_encodeSnappyBlockAsm12B + JB match_nolit_end_encodeSnappyBlockAsm12B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm12B @@ -12504,7 +12573,7 @@ match_nolit_end_encodeSnappyBlockAsm12B: // emitCopy two_byte_offset_match_nolit_encodeSnappyBlockAsm12B: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm12B + JBE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm12B MOVB $0xee, (AX) MOVW BX, 1(AX) LEAL -60(R9), R9 @@ -12515,9 +12584,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBlockAsm12B: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm12B + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm12B CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm12B + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm12B LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -12535,10 +12604,10 @@ emit_copy_three_match_nolit_encodeSnappyBlockAsm12B: match_nolit_emitcopy_end_encodeSnappyBlockAsm12B: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm12B + JAE emit_remainder_encodeSnappyBlockAsm12B MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBlockAsm12B + JB match_nolit_dst_ok_encodeSnappyBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -12568,7 +12637,7 @@ emit_remainder_encodeSnappyBlockAsm12B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBlockAsm12B + JB emit_remainder_ok_encodeSnappyBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -12583,9 +12652,12 @@ emit_remainder_ok_encodeSnappyBlockAsm12B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBlockAsm12B + JB one_byte_emit_remainder_encodeSnappyBlockAsm12B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBlockAsm12B + JB two_bytes_emit_remainder_encodeSnappyBlockAsm12B + JB three_bytes_emit_remainder_encodeSnappyBlockAsm12B + +three_bytes_emit_remainder_encodeSnappyBlockAsm12B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -12596,7 +12668,7 @@ two_bytes_emit_remainder_encodeSnappyBlockAsm12B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBlockAsm12B + JB memmove_emit_remainder_encodeSnappyBlockAsm12B JMP memmove_long_emit_remainder_encodeSnappyBlockAsm12B one_byte_emit_remainder_encodeSnappyBlockAsm12B: @@ -12759,7 +12831,7 @@ search_loop_encodeSnappyBlockAsm10B: SHRL $0x05, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm10B + JAE emit_remainder_encodeSnappyBlockAsm10B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x9e3779b1, R8 @@ -12797,7 +12869,7 @@ search_loop_encodeSnappyBlockAsm10B: repeat_extend_back_loop_encodeSnappyBlockAsm10B: CMPL SI, BX - JLE repeat_extend_back_end_encodeSnappyBlockAsm10B + JBE repeat_extend_back_end_encodeSnappyBlockAsm10B MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -12816,9 +12888,12 @@ repeat_extend_back_end_encodeSnappyBlockAsm10B: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeSnappyBlockAsm10B + JB one_byte_repeat_emit_encodeSnappyBlockAsm10B CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeSnappyBlockAsm10B + JB two_bytes_repeat_emit_encodeSnappyBlockAsm10B + JB three_bytes_repeat_emit_encodeSnappyBlockAsm10B + +three_bytes_repeat_emit_encodeSnappyBlockAsm10B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -12829,7 +12904,7 @@ two_bytes_repeat_emit_encodeSnappyBlockAsm10B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeSnappyBlockAsm10B + JB memmove_repeat_emit_encodeSnappyBlockAsm10B JMP memmove_long_repeat_emit_encodeSnappyBlockAsm10B one_byte_repeat_emit_encodeSnappyBlockAsm10B: @@ -12842,7 +12917,7 @@ memmove_repeat_emit_encodeSnappyBlockAsm10B: // genMemMoveShort CMPQ DI, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8 CMPQ DI, $0x10 JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm10B_memmove_move_8through16 CMPQ DI, $0x20 @@ -12938,7 +13013,7 @@ emit_literal_done_repeat_emit_encodeSnappyBlockAsm10B: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B + JB matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B matchlen_loopback_repeat_extend_encodeSnappyBlockAsm10B: MOVQ (R8)(R10*1), R9 @@ -12961,12 +13036,12 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm10B: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm10B + JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm10B JZ repeat_extend_forward_end_encodeSnappyBlockAsm10B matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B + JB matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B @@ -12975,7 +13050,7 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B: matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B + JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B @@ -12984,7 +13059,7 @@ matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B: matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B: CMPL DI, $0x01 - JL repeat_extend_forward_end_encodeSnappyBlockAsm10B + JB repeat_extend_forward_end_encodeSnappyBlockAsm10B MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm10B @@ -12999,7 +13074,7 @@ repeat_extend_forward_end_encodeSnappyBlockAsm10B: // emitCopy two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm10B: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm10B + JBE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm10B MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(BX), BX @@ -13010,9 +13085,9 @@ two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm10B: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm10B LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -13063,7 +13138,7 @@ candidate_match_encodeSnappyBlockAsm10B: match_extend_back_loop_encodeSnappyBlockAsm10B: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBlockAsm10B + JBE match_extend_back_end_encodeSnappyBlockAsm10B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -13078,7 +13153,7 @@ match_extend_back_end_encodeSnappyBlockAsm10B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBlockAsm10B + JB match_dst_size_check_encodeSnappyBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -13093,9 +13168,12 @@ match_dst_size_check_encodeSnappyBlockAsm10B: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeSnappyBlockAsm10B + JB one_byte_match_emit_encodeSnappyBlockAsm10B CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBlockAsm10B + JB two_bytes_match_emit_encodeSnappyBlockAsm10B + JB three_bytes_match_emit_encodeSnappyBlockAsm10B + +three_bytes_match_emit_encodeSnappyBlockAsm10B: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -13106,7 +13184,7 @@ two_bytes_match_emit_encodeSnappyBlockAsm10B: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeSnappyBlockAsm10B + JB memmove_match_emit_encodeSnappyBlockAsm10B JMP memmove_long_match_emit_encodeSnappyBlockAsm10B one_byte_match_emit_encodeSnappyBlockAsm10B: @@ -13119,7 +13197,7 @@ memmove_match_emit_encodeSnappyBlockAsm10B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm10B_memmove_move_8through16 CMPQ R8, $0x20 @@ -13218,7 +13296,7 @@ match_nolit_loop_encodeSnappyBlockAsm10B: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBlockAsm10B + JB matchlen_match4_match_nolit_encodeSnappyBlockAsm10B matchlen_loopback_match_nolit_encodeSnappyBlockAsm10B: MOVQ (DI)(R9*1), R8 @@ -13241,12 +13319,12 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm10B: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBlockAsm10B + JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm10B JZ match_nolit_end_encodeSnappyBlockAsm10B matchlen_match4_match_nolit_encodeSnappyBlockAsm10B: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBlockAsm10B + JB matchlen_match2_match_nolit_encodeSnappyBlockAsm10B MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm10B @@ -13255,7 +13333,7 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm10B: matchlen_match2_match_nolit_encodeSnappyBlockAsm10B: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBlockAsm10B + JB matchlen_match1_match_nolit_encodeSnappyBlockAsm10B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm10B @@ -13264,7 +13342,7 @@ matchlen_match2_match_nolit_encodeSnappyBlockAsm10B: matchlen_match1_match_nolit_encodeSnappyBlockAsm10B: CMPL SI, $0x01 - JL match_nolit_end_encodeSnappyBlockAsm10B + JB match_nolit_end_encodeSnappyBlockAsm10B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm10B @@ -13279,7 +13357,7 @@ match_nolit_end_encodeSnappyBlockAsm10B: // emitCopy two_byte_offset_match_nolit_encodeSnappyBlockAsm10B: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm10B + JBE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm10B MOVB $0xee, (AX) MOVW BX, 1(AX) LEAL -60(R9), R9 @@ -13290,9 +13368,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBlockAsm10B: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm10B + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm10B CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm10B + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm10B LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -13310,10 +13388,10 @@ emit_copy_three_match_nolit_encodeSnappyBlockAsm10B: match_nolit_emitcopy_end_encodeSnappyBlockAsm10B: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm10B + JAE emit_remainder_encodeSnappyBlockAsm10B MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBlockAsm10B + JB match_nolit_dst_ok_encodeSnappyBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -13343,7 +13421,7 @@ emit_remainder_encodeSnappyBlockAsm10B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBlockAsm10B + JB emit_remainder_ok_encodeSnappyBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -13358,9 +13436,12 @@ emit_remainder_ok_encodeSnappyBlockAsm10B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBlockAsm10B + JB one_byte_emit_remainder_encodeSnappyBlockAsm10B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBlockAsm10B + JB two_bytes_emit_remainder_encodeSnappyBlockAsm10B + JB three_bytes_emit_remainder_encodeSnappyBlockAsm10B + +three_bytes_emit_remainder_encodeSnappyBlockAsm10B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -13371,7 +13452,7 @@ two_bytes_emit_remainder_encodeSnappyBlockAsm10B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBlockAsm10B + JB memmove_emit_remainder_encodeSnappyBlockAsm10B JMP memmove_long_emit_remainder_encodeSnappyBlockAsm10B one_byte_emit_remainder_encodeSnappyBlockAsm10B: @@ -13534,7 +13615,7 @@ search_loop_encodeSnappyBlockAsm8B: SHRL $0x04, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm8B + JAE emit_remainder_encodeSnappyBlockAsm8B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x9e3779b1, R8 @@ -13572,7 +13653,7 @@ search_loop_encodeSnappyBlockAsm8B: repeat_extend_back_loop_encodeSnappyBlockAsm8B: CMPL SI, BX - JLE repeat_extend_back_end_encodeSnappyBlockAsm8B + JBE repeat_extend_back_end_encodeSnappyBlockAsm8B MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -13591,9 +13672,12 @@ repeat_extend_back_end_encodeSnappyBlockAsm8B: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_encodeSnappyBlockAsm8B + JB one_byte_repeat_emit_encodeSnappyBlockAsm8B CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_encodeSnappyBlockAsm8B + JB two_bytes_repeat_emit_encodeSnappyBlockAsm8B + JB three_bytes_repeat_emit_encodeSnappyBlockAsm8B + +three_bytes_repeat_emit_encodeSnappyBlockAsm8B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -13604,7 +13688,7 @@ two_bytes_repeat_emit_encodeSnappyBlockAsm8B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_encodeSnappyBlockAsm8B + JB memmove_repeat_emit_encodeSnappyBlockAsm8B JMP memmove_long_repeat_emit_encodeSnappyBlockAsm8B one_byte_repeat_emit_encodeSnappyBlockAsm8B: @@ -13617,7 +13701,7 @@ memmove_repeat_emit_encodeSnappyBlockAsm8B: // genMemMoveShort CMPQ DI, $0x08 - JLE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8 + JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8 CMPQ DI, $0x10 JBE emit_lit_memmove_repeat_emit_encodeSnappyBlockAsm8B_memmove_move_8through16 CMPQ DI, $0x20 @@ -13713,7 +13797,7 @@ emit_literal_done_repeat_emit_encodeSnappyBlockAsm8B: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B + JB matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B matchlen_loopback_repeat_extend_encodeSnappyBlockAsm8B: MOVQ (R8)(R10*1), R9 @@ -13736,12 +13820,12 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm8B: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm8B + JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm8B JZ repeat_extend_forward_end_encodeSnappyBlockAsm8B matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B + JB matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B @@ -13750,7 +13834,7 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B: matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B + JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B @@ -13759,7 +13843,7 @@ matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B: matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B: CMPL DI, $0x01 - JL repeat_extend_forward_end_encodeSnappyBlockAsm8B + JB repeat_extend_forward_end_encodeSnappyBlockAsm8B MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm8B @@ -13774,7 +13858,7 @@ repeat_extend_forward_end_encodeSnappyBlockAsm8B: // emitCopy two_byte_offset_repeat_as_copy_encodeSnappyBlockAsm8B: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm8B + JBE two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm8B MOVB $0xee, (AX) MOVW SI, 1(AX) LEAL -60(BX), BX @@ -13785,7 +13869,7 @@ two_byte_offset_short_repeat_as_copy_encodeSnappyBlockAsm8B: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm8B + JAE emit_copy_three_repeat_as_copy_encodeSnappyBlockAsm8B LEAL -15(DI), DI MOVB SI, 1(AX) SHRL $0x08, SI @@ -13836,7 +13920,7 @@ candidate_match_encodeSnappyBlockAsm8B: match_extend_back_loop_encodeSnappyBlockAsm8B: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBlockAsm8B + JBE match_extend_back_end_encodeSnappyBlockAsm8B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -13851,7 +13935,7 @@ match_extend_back_end_encodeSnappyBlockAsm8B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBlockAsm8B + JB match_dst_size_check_encodeSnappyBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -13866,9 +13950,12 @@ match_dst_size_check_encodeSnappyBlockAsm8B: SUBL DI, R8 LEAL -1(R8), DI CMPL DI, $0x3c - JLT one_byte_match_emit_encodeSnappyBlockAsm8B + JB one_byte_match_emit_encodeSnappyBlockAsm8B CMPL DI, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBlockAsm8B + JB two_bytes_match_emit_encodeSnappyBlockAsm8B + JB three_bytes_match_emit_encodeSnappyBlockAsm8B + +three_bytes_match_emit_encodeSnappyBlockAsm8B: MOVB $0xf4, (AX) MOVW DI, 1(AX) ADDQ $0x03, AX @@ -13879,7 +13966,7 @@ two_bytes_match_emit_encodeSnappyBlockAsm8B: MOVB DI, 1(AX) ADDQ $0x02, AX CMPL DI, $0x40 - JL memmove_match_emit_encodeSnappyBlockAsm8B + JB memmove_match_emit_encodeSnappyBlockAsm8B JMP memmove_long_match_emit_encodeSnappyBlockAsm8B one_byte_match_emit_encodeSnappyBlockAsm8B: @@ -13892,7 +13979,7 @@ memmove_match_emit_encodeSnappyBlockAsm8B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBlockAsm8B_memmove_move_8through16 CMPQ R8, $0x20 @@ -13991,7 +14078,7 @@ match_nolit_loop_encodeSnappyBlockAsm8B: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBlockAsm8B + JB matchlen_match4_match_nolit_encodeSnappyBlockAsm8B matchlen_loopback_match_nolit_encodeSnappyBlockAsm8B: MOVQ (DI)(R9*1), R8 @@ -14014,12 +14101,12 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm8B: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBlockAsm8B + JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm8B JZ match_nolit_end_encodeSnappyBlockAsm8B matchlen_match4_match_nolit_encodeSnappyBlockAsm8B: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBlockAsm8B + JB matchlen_match2_match_nolit_encodeSnappyBlockAsm8B MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm8B @@ -14028,7 +14115,7 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm8B: matchlen_match2_match_nolit_encodeSnappyBlockAsm8B: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBlockAsm8B + JB matchlen_match1_match_nolit_encodeSnappyBlockAsm8B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm8B @@ -14037,7 +14124,7 @@ matchlen_match2_match_nolit_encodeSnappyBlockAsm8B: matchlen_match1_match_nolit_encodeSnappyBlockAsm8B: CMPL SI, $0x01 - JL match_nolit_end_encodeSnappyBlockAsm8B + JB match_nolit_end_encodeSnappyBlockAsm8B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm8B @@ -14052,7 +14139,7 @@ match_nolit_end_encodeSnappyBlockAsm8B: // emitCopy two_byte_offset_match_nolit_encodeSnappyBlockAsm8B: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm8B + JBE two_byte_offset_short_match_nolit_encodeSnappyBlockAsm8B MOVB $0xee, (AX) MOVW BX, 1(AX) LEAL -60(R9), R9 @@ -14063,7 +14150,7 @@ two_byte_offset_short_match_nolit_encodeSnappyBlockAsm8B: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBlockAsm8B + JAE emit_copy_three_match_nolit_encodeSnappyBlockAsm8B LEAL -15(SI), SI MOVB BL, 1(AX) SHRL $0x08, BX @@ -14081,10 +14168,10 @@ emit_copy_three_match_nolit_encodeSnappyBlockAsm8B: match_nolit_emitcopy_end_encodeSnappyBlockAsm8B: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBlockAsm8B + JAE emit_remainder_encodeSnappyBlockAsm8B MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBlockAsm8B + JB match_nolit_dst_ok_encodeSnappyBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -14114,7 +14201,7 @@ emit_remainder_encodeSnappyBlockAsm8B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBlockAsm8B + JB emit_remainder_ok_encodeSnappyBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -14129,9 +14216,12 @@ emit_remainder_ok_encodeSnappyBlockAsm8B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBlockAsm8B + JB one_byte_emit_remainder_encodeSnappyBlockAsm8B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBlockAsm8B + JB two_bytes_emit_remainder_encodeSnappyBlockAsm8B + JB three_bytes_emit_remainder_encodeSnappyBlockAsm8B + +three_bytes_emit_remainder_encodeSnappyBlockAsm8B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -14142,7 +14232,7 @@ two_bytes_emit_remainder_encodeSnappyBlockAsm8B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBlockAsm8B + JB memmove_emit_remainder_encodeSnappyBlockAsm8B JMP memmove_long_emit_remainder_encodeSnappyBlockAsm8B one_byte_emit_remainder_encodeSnappyBlockAsm8B: @@ -14304,7 +14394,7 @@ search_loop_encodeSnappyBetterBlockAsm: SUBL 12(SP), BX SHRL $0x07, BX CMPL BX, $0x63 - JLE check_maxskip_ok_encodeSnappyBetterBlockAsm + JBE check_maxskip_ok_encodeSnappyBetterBlockAsm LEAL 100(CX), BX JMP check_maxskip_cont_encodeSnappyBetterBlockAsm @@ -14313,7 +14403,7 @@ check_maxskip_ok_encodeSnappyBetterBlockAsm: check_maxskip_cont_encodeSnappyBetterBlockAsm: CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm + JAE emit_remainder_encodeSnappyBetterBlockAsm MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x00cf1bbcdcbfa563, R8 @@ -14368,7 +14458,7 @@ candidate_match_encodeSnappyBetterBlockAsm: match_extend_back_loop_encodeSnappyBetterBlockAsm: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBetterBlockAsm + JBE match_extend_back_end_encodeSnappyBetterBlockAsm MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -14383,7 +14473,7 @@ match_extend_back_end_encodeSnappyBetterBlockAsm: SUBL 12(SP), SI LEAQ 5(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBetterBlockAsm + JB match_dst_size_check_encodeSnappyBetterBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -14399,7 +14489,7 @@ match_dst_size_check_encodeSnappyBetterBlockAsm: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm + JB matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm: MOVQ (R8)(R11*1), R10 @@ -14422,12 +14512,12 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm + JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm JZ match_nolit_end_encodeSnappyBetterBlockAsm matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm + JB matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm @@ -14436,7 +14526,7 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm: matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm + JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm @@ -14445,7 +14535,7 @@ matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm: matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm: CMPL DI, $0x01 - JL match_nolit_end_encodeSnappyBetterBlockAsm + JB match_nolit_end_encodeSnappyBetterBlockAsm MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm @@ -14457,9 +14547,9 @@ match_nolit_end_encodeSnappyBetterBlockAsm: // Check if repeat CMPL R11, $0x01 - JG match_length_ok_encodeSnappyBetterBlockAsm + JA match_length_ok_encodeSnappyBetterBlockAsm CMPL DI, $0x0000ffff - JLE match_length_ok_encodeSnappyBetterBlockAsm + JBE match_length_ok_encodeSnappyBetterBlockAsm MOVL 20(SP), CX INCL CX JMP search_loop_encodeSnappyBetterBlockAsm @@ -14475,13 +14565,13 @@ match_length_ok_encodeSnappyBetterBlockAsm: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeSnappyBetterBlockAsm + JB one_byte_match_emit_encodeSnappyBetterBlockAsm CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBetterBlockAsm + JB two_bytes_match_emit_encodeSnappyBetterBlockAsm CMPL BX, $0x00010000 - JLT three_bytes_match_emit_encodeSnappyBetterBlockAsm + JB three_bytes_match_emit_encodeSnappyBetterBlockAsm CMPL BX, $0x01000000 - JLT four_bytes_match_emit_encodeSnappyBetterBlockAsm + JB four_bytes_match_emit_encodeSnappyBetterBlockAsm MOVB $0xfc, (AX) MOVL BX, 1(AX) ADDQ $0x05, AX @@ -14507,7 +14597,7 @@ two_bytes_match_emit_encodeSnappyBetterBlockAsm: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeSnappyBetterBlockAsm + JB memmove_match_emit_encodeSnappyBetterBlockAsm JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm one_byte_match_emit_encodeSnappyBetterBlockAsm: @@ -14520,7 +14610,7 @@ memmove_match_emit_encodeSnappyBetterBlockAsm: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm_memmove_move_8through16 CMPQ R8, $0x20 @@ -14611,17 +14701,17 @@ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm: // emitCopy CMPL DI, $0x00010000 - JL two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm + JB two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm four_bytes_loop_back_match_nolit_encodeSnappyBetterBlockAsm: CMPL R11, $0x40 - JLE four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm + JBE four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm MOVB $0xff, (AX) MOVL DI, 1(AX) LEAL -64(R11), R11 ADDQ $0x05, AX CMPL R11, $0x04 - JL four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm + JB four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm JMP four_bytes_loop_back_match_nolit_encodeSnappyBetterBlockAsm four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm: @@ -14636,7 +14726,7 @@ four_bytes_remain_match_nolit_encodeSnappyBetterBlockAsm: two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm + JBE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(R11), R11 @@ -14647,9 +14737,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -14667,9 +14757,9 @@ emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm: match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm + JAE emit_remainder_encodeSnappyBetterBlockAsm CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBetterBlockAsm + JB match_nolit_dst_ok_encodeSnappyBetterBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -14725,7 +14815,7 @@ emit_remainder_encodeSnappyBetterBlockAsm: SUBL 12(SP), CX LEAQ 5(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBetterBlockAsm + JB emit_remainder_ok_encodeSnappyBetterBlockAsm MOVQ $0x00000000, ret+48(FP) RET @@ -14740,13 +14830,13 @@ emit_remainder_ok_encodeSnappyBetterBlockAsm: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBetterBlockAsm + JB one_byte_emit_remainder_encodeSnappyBetterBlockAsm CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBetterBlockAsm + JB two_bytes_emit_remainder_encodeSnappyBetterBlockAsm CMPL DX, $0x00010000 - JLT three_bytes_emit_remainder_encodeSnappyBetterBlockAsm + JB three_bytes_emit_remainder_encodeSnappyBetterBlockAsm CMPL DX, $0x01000000 - JLT four_bytes_emit_remainder_encodeSnappyBetterBlockAsm + JB four_bytes_emit_remainder_encodeSnappyBetterBlockAsm MOVB $0xfc, (AX) MOVL DX, 1(AX) ADDQ $0x05, AX @@ -14772,7 +14862,7 @@ two_bytes_emit_remainder_encodeSnappyBetterBlockAsm: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBetterBlockAsm + JB memmove_emit_remainder_encodeSnappyBetterBlockAsm JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm one_byte_emit_remainder_encodeSnappyBetterBlockAsm: @@ -14935,7 +15025,7 @@ search_loop_encodeSnappyBetterBlockAsm64K: SHRL $0x07, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm64K + JAE emit_remainder_encodeSnappyBetterBlockAsm64K MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x00cf1bbcdcbfa563, R8 @@ -14990,7 +15080,7 @@ candidate_match_encodeSnappyBetterBlockAsm64K: match_extend_back_loop_encodeSnappyBetterBlockAsm64K: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBetterBlockAsm64K + JBE match_extend_back_end_encodeSnappyBetterBlockAsm64K MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -15005,7 +15095,7 @@ match_extend_back_end_encodeSnappyBetterBlockAsm64K: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBetterBlockAsm64K + JB match_dst_size_check_encodeSnappyBetterBlockAsm64K MOVQ $0x00000000, ret+48(FP) RET @@ -15021,7 +15111,7 @@ match_dst_size_check_encodeSnappyBetterBlockAsm64K: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K + JB matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm64K: MOVQ (R8)(R11*1), R10 @@ -15044,12 +15134,12 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm64K: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm64K + JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm64K JZ match_nolit_end_encodeSnappyBetterBlockAsm64K matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K + JB matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K @@ -15058,7 +15148,7 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K: matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K + JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K @@ -15067,7 +15157,7 @@ matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K: matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL DI, $0x01 - JL match_nolit_end_encodeSnappyBetterBlockAsm64K + JB match_nolit_end_encodeSnappyBetterBlockAsm64K MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm64K @@ -15088,9 +15178,12 @@ match_nolit_end_encodeSnappyBetterBlockAsm64K: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeSnappyBetterBlockAsm64K + JB one_byte_match_emit_encodeSnappyBetterBlockAsm64K CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBetterBlockAsm64K + JB two_bytes_match_emit_encodeSnappyBetterBlockAsm64K + JB three_bytes_match_emit_encodeSnappyBetterBlockAsm64K + +three_bytes_match_emit_encodeSnappyBetterBlockAsm64K: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -15101,7 +15194,7 @@ two_bytes_match_emit_encodeSnappyBetterBlockAsm64K: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeSnappyBetterBlockAsm64K + JB memmove_match_emit_encodeSnappyBetterBlockAsm64K JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm64K one_byte_match_emit_encodeSnappyBetterBlockAsm64K: @@ -15114,7 +15207,7 @@ memmove_match_emit_encodeSnappyBetterBlockAsm64K: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm64K_memmove_move_8through16 CMPQ R8, $0x20 @@ -15206,7 +15299,7 @@ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm64K: // emitCopy two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm64K + JBE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm64K MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(R11), R11 @@ -15217,9 +15310,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm64K: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -15237,9 +15330,9 @@ emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm64K: match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm64K: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm64K + JAE emit_remainder_encodeSnappyBetterBlockAsm64K CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBetterBlockAsm64K + JB match_nolit_dst_ok_encodeSnappyBetterBlockAsm64K MOVQ $0x00000000, ret+48(FP) RET @@ -15295,7 +15388,7 @@ emit_remainder_encodeSnappyBetterBlockAsm64K: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBetterBlockAsm64K + JB emit_remainder_ok_encodeSnappyBetterBlockAsm64K MOVQ $0x00000000, ret+48(FP) RET @@ -15310,9 +15403,12 @@ emit_remainder_ok_encodeSnappyBetterBlockAsm64K: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBetterBlockAsm64K + JB one_byte_emit_remainder_encodeSnappyBetterBlockAsm64K CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K + JB two_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K + JB three_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -15323,7 +15419,7 @@ two_bytes_emit_remainder_encodeSnappyBetterBlockAsm64K: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBetterBlockAsm64K + JB memmove_emit_remainder_encodeSnappyBetterBlockAsm64K JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm64K one_byte_emit_remainder_encodeSnappyBetterBlockAsm64K: @@ -15486,7 +15582,7 @@ search_loop_encodeSnappyBetterBlockAsm12B: SHRL $0x06, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm12B + JAE emit_remainder_encodeSnappyBetterBlockAsm12B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -15541,7 +15637,7 @@ candidate_match_encodeSnappyBetterBlockAsm12B: match_extend_back_loop_encodeSnappyBetterBlockAsm12B: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBetterBlockAsm12B + JBE match_extend_back_end_encodeSnappyBetterBlockAsm12B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -15556,7 +15652,7 @@ match_extend_back_end_encodeSnappyBetterBlockAsm12B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBetterBlockAsm12B + JB match_dst_size_check_encodeSnappyBetterBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -15572,7 +15668,7 @@ match_dst_size_check_encodeSnappyBetterBlockAsm12B: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B + JB matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm12B: MOVQ (R8)(R11*1), R10 @@ -15595,12 +15691,12 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm12B: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm12B + JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm12B JZ match_nolit_end_encodeSnappyBetterBlockAsm12B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B + JB matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B @@ -15609,7 +15705,7 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B: matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B + JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B @@ -15618,7 +15714,7 @@ matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B: matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL DI, $0x01 - JL match_nolit_end_encodeSnappyBetterBlockAsm12B + JB match_nolit_end_encodeSnappyBetterBlockAsm12B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm12B @@ -15639,9 +15735,12 @@ match_nolit_end_encodeSnappyBetterBlockAsm12B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeSnappyBetterBlockAsm12B + JB one_byte_match_emit_encodeSnappyBetterBlockAsm12B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBetterBlockAsm12B + JB two_bytes_match_emit_encodeSnappyBetterBlockAsm12B + JB three_bytes_match_emit_encodeSnappyBetterBlockAsm12B + +three_bytes_match_emit_encodeSnappyBetterBlockAsm12B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -15652,7 +15751,7 @@ two_bytes_match_emit_encodeSnappyBetterBlockAsm12B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeSnappyBetterBlockAsm12B + JB memmove_match_emit_encodeSnappyBetterBlockAsm12B JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm12B one_byte_match_emit_encodeSnappyBetterBlockAsm12B: @@ -15665,7 +15764,7 @@ memmove_match_emit_encodeSnappyBetterBlockAsm12B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm12B_memmove_move_8through16 CMPQ R8, $0x20 @@ -15757,7 +15856,7 @@ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm12B: // emitCopy two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm12B + JBE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm12B MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(R11), R11 @@ -15768,9 +15867,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm12B: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -15788,9 +15887,9 @@ emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm12B: match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm12B: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm12B + JAE emit_remainder_encodeSnappyBetterBlockAsm12B CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBetterBlockAsm12B + JB match_nolit_dst_ok_encodeSnappyBetterBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -15846,7 +15945,7 @@ emit_remainder_encodeSnappyBetterBlockAsm12B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBetterBlockAsm12B + JB emit_remainder_ok_encodeSnappyBetterBlockAsm12B MOVQ $0x00000000, ret+48(FP) RET @@ -15861,9 +15960,12 @@ emit_remainder_ok_encodeSnappyBetterBlockAsm12B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBetterBlockAsm12B + JB one_byte_emit_remainder_encodeSnappyBetterBlockAsm12B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B + JB two_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B + JB three_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -15874,7 +15976,7 @@ two_bytes_emit_remainder_encodeSnappyBetterBlockAsm12B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBetterBlockAsm12B + JB memmove_emit_remainder_encodeSnappyBetterBlockAsm12B JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm12B one_byte_emit_remainder_encodeSnappyBetterBlockAsm12B: @@ -16037,7 +16139,7 @@ search_loop_encodeSnappyBetterBlockAsm10B: SHRL $0x05, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm10B + JAE emit_remainder_encodeSnappyBetterBlockAsm10B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -16092,7 +16194,7 @@ candidate_match_encodeSnappyBetterBlockAsm10B: match_extend_back_loop_encodeSnappyBetterBlockAsm10B: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBetterBlockAsm10B + JBE match_extend_back_end_encodeSnappyBetterBlockAsm10B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -16107,7 +16209,7 @@ match_extend_back_end_encodeSnappyBetterBlockAsm10B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBetterBlockAsm10B + JB match_dst_size_check_encodeSnappyBetterBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -16123,7 +16225,7 @@ match_dst_size_check_encodeSnappyBetterBlockAsm10B: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B + JB matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm10B: MOVQ (R8)(R11*1), R10 @@ -16146,12 +16248,12 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm10B: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm10B + JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm10B JZ match_nolit_end_encodeSnappyBetterBlockAsm10B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B + JB matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B @@ -16160,7 +16262,7 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B: matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B + JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B @@ -16169,7 +16271,7 @@ matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B: matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL DI, $0x01 - JL match_nolit_end_encodeSnappyBetterBlockAsm10B + JB match_nolit_end_encodeSnappyBetterBlockAsm10B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm10B @@ -16190,9 +16292,12 @@ match_nolit_end_encodeSnappyBetterBlockAsm10B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeSnappyBetterBlockAsm10B + JB one_byte_match_emit_encodeSnappyBetterBlockAsm10B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBetterBlockAsm10B + JB two_bytes_match_emit_encodeSnappyBetterBlockAsm10B + JB three_bytes_match_emit_encodeSnappyBetterBlockAsm10B + +three_bytes_match_emit_encodeSnappyBetterBlockAsm10B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -16203,7 +16308,7 @@ two_bytes_match_emit_encodeSnappyBetterBlockAsm10B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeSnappyBetterBlockAsm10B + JB memmove_match_emit_encodeSnappyBetterBlockAsm10B JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm10B one_byte_match_emit_encodeSnappyBetterBlockAsm10B: @@ -16216,7 +16321,7 @@ memmove_match_emit_encodeSnappyBetterBlockAsm10B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm10B_memmove_move_8through16 CMPQ R8, $0x20 @@ -16308,7 +16413,7 @@ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm10B: // emitCopy two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm10B + JBE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm10B MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(R11), R11 @@ -16319,9 +16424,9 @@ two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm10B: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B CMPL DI, $0x00000800 - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -16339,9 +16444,9 @@ emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm10B: match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm10B: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm10B + JAE emit_remainder_encodeSnappyBetterBlockAsm10B CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBetterBlockAsm10B + JB match_nolit_dst_ok_encodeSnappyBetterBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -16397,7 +16502,7 @@ emit_remainder_encodeSnappyBetterBlockAsm10B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBetterBlockAsm10B + JB emit_remainder_ok_encodeSnappyBetterBlockAsm10B MOVQ $0x00000000, ret+48(FP) RET @@ -16412,9 +16517,12 @@ emit_remainder_ok_encodeSnappyBetterBlockAsm10B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBetterBlockAsm10B + JB one_byte_emit_remainder_encodeSnappyBetterBlockAsm10B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B + JB two_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B + JB three_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -16425,7 +16533,7 @@ two_bytes_emit_remainder_encodeSnappyBetterBlockAsm10B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBetterBlockAsm10B + JB memmove_emit_remainder_encodeSnappyBetterBlockAsm10B JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm10B one_byte_emit_remainder_encodeSnappyBetterBlockAsm10B: @@ -16588,7 +16696,7 @@ search_loop_encodeSnappyBetterBlockAsm8B: SHRL $0x04, BX LEAL 1(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm8B + JAE emit_remainder_encodeSnappyBetterBlockAsm8B MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -16643,7 +16751,7 @@ candidate_match_encodeSnappyBetterBlockAsm8B: match_extend_back_loop_encodeSnappyBetterBlockAsm8B: CMPL CX, SI - JLE match_extend_back_end_encodeSnappyBetterBlockAsm8B + JBE match_extend_back_end_encodeSnappyBetterBlockAsm8B MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -16658,7 +16766,7 @@ match_extend_back_end_encodeSnappyBetterBlockAsm8B: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_encodeSnappyBetterBlockAsm8B + JB match_dst_size_check_encodeSnappyBetterBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -16674,7 +16782,7 @@ match_dst_size_check_encodeSnappyBetterBlockAsm8B: // matchLen XORL R11, R11 CMPL DI, $0x08 - JL matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B + JB matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm8B: MOVQ (R8)(R11*1), R10 @@ -16697,12 +16805,12 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm8B: LEAL -8(DI), DI LEAL 8(R11), R11 CMPL DI, $0x08 - JGE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm8B + JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm8B JZ match_nolit_end_encodeSnappyBetterBlockAsm8B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL DI, $0x04 - JL matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B + JB matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B @@ -16711,7 +16819,7 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B: matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL DI, $0x02 - JL matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B + JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B @@ -16720,7 +16828,7 @@ matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B: matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL DI, $0x01 - JL match_nolit_end_encodeSnappyBetterBlockAsm8B + JB match_nolit_end_encodeSnappyBetterBlockAsm8B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm8B @@ -16741,9 +16849,12 @@ match_nolit_end_encodeSnappyBetterBlockAsm8B: SUBL BX, R8 LEAL -1(R8), BX CMPL BX, $0x3c - JLT one_byte_match_emit_encodeSnappyBetterBlockAsm8B + JB one_byte_match_emit_encodeSnappyBetterBlockAsm8B CMPL BX, $0x00000100 - JLT two_bytes_match_emit_encodeSnappyBetterBlockAsm8B + JB two_bytes_match_emit_encodeSnappyBetterBlockAsm8B + JB three_bytes_match_emit_encodeSnappyBetterBlockAsm8B + +three_bytes_match_emit_encodeSnappyBetterBlockAsm8B: MOVB $0xf4, (AX) MOVW BX, 1(AX) ADDQ $0x03, AX @@ -16754,7 +16865,7 @@ two_bytes_match_emit_encodeSnappyBetterBlockAsm8B: MOVB BL, 1(AX) ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_match_emit_encodeSnappyBetterBlockAsm8B + JB memmove_match_emit_encodeSnappyBetterBlockAsm8B JMP memmove_long_match_emit_encodeSnappyBetterBlockAsm8B one_byte_match_emit_encodeSnappyBetterBlockAsm8B: @@ -16767,7 +16878,7 @@ memmove_match_emit_encodeSnappyBetterBlockAsm8B: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8 + JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_match_emit_encodeSnappyBetterBlockAsm8B_memmove_move_8through16 CMPQ R8, $0x20 @@ -16859,7 +16970,7 @@ emit_literal_done_match_emit_encodeSnappyBetterBlockAsm8B: // emitCopy two_byte_offset_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL R11, $0x40 - JLE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm8B + JBE two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm8B MOVB $0xee, (AX) MOVW DI, 1(AX) LEAL -60(R11), R11 @@ -16870,7 +16981,7 @@ two_byte_offset_short_match_nolit_encodeSnappyBetterBlockAsm8B: MOVL R11, BX SHLL $0x02, BX CMPL R11, $0x0c - JGE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm8B + JAE emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm8B LEAL -15(BX), BX MOVB DI, 1(AX) SHRL $0x08, DI @@ -16888,9 +16999,9 @@ emit_copy_three_match_nolit_encodeSnappyBetterBlockAsm8B: match_nolit_emitcopy_end_encodeSnappyBetterBlockAsm8B: CMPL CX, 8(SP) - JGE emit_remainder_encodeSnappyBetterBlockAsm8B + JAE emit_remainder_encodeSnappyBetterBlockAsm8B CMPQ AX, (SP) - JL match_nolit_dst_ok_encodeSnappyBetterBlockAsm8B + JB match_nolit_dst_ok_encodeSnappyBetterBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -16946,7 +17057,7 @@ emit_remainder_encodeSnappyBetterBlockAsm8B: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_encodeSnappyBetterBlockAsm8B + JB emit_remainder_ok_encodeSnappyBetterBlockAsm8B MOVQ $0x00000000, ret+48(FP) RET @@ -16961,9 +17072,12 @@ emit_remainder_ok_encodeSnappyBetterBlockAsm8B: SUBL BX, SI LEAL -1(SI), DX CMPL DX, $0x3c - JLT one_byte_emit_remainder_encodeSnappyBetterBlockAsm8B + JB one_byte_emit_remainder_encodeSnappyBetterBlockAsm8B CMPL DX, $0x00000100 - JLT two_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B + JB two_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B + JB three_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B + +three_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B: MOVB $0xf4, (AX) MOVW DX, 1(AX) ADDQ $0x03, AX @@ -16974,7 +17088,7 @@ two_bytes_emit_remainder_encodeSnappyBetterBlockAsm8B: MOVB DL, 1(AX) ADDQ $0x02, AX CMPL DX, $0x40 - JL memmove_emit_remainder_encodeSnappyBetterBlockAsm8B + JB memmove_emit_remainder_encodeSnappyBetterBlockAsm8B JMP memmove_long_emit_remainder_encodeSnappyBetterBlockAsm8B one_byte_emit_remainder_encodeSnappyBetterBlockAsm8B: @@ -17137,7 +17251,7 @@ search_loop_calcBlockSize: SHRL $0x05, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_calcBlockSize + JAE emit_remainder_calcBlockSize MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x0000cf1bbcdcbf9b, R8 @@ -17175,7 +17289,7 @@ search_loop_calcBlockSize: repeat_extend_back_loop_calcBlockSize: CMPL SI, BX - JLE repeat_extend_back_end_calcBlockSize + JBE repeat_extend_back_end_calcBlockSize MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -17194,13 +17308,13 @@ repeat_extend_back_end_calcBlockSize: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_calcBlockSize + JB one_byte_repeat_emit_calcBlockSize CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_calcBlockSize + JB two_bytes_repeat_emit_calcBlockSize CMPL BX, $0x00010000 - JLT three_bytes_repeat_emit_calcBlockSize + JB three_bytes_repeat_emit_calcBlockSize CMPL BX, $0x01000000 - JLT four_bytes_repeat_emit_calcBlockSize + JB four_bytes_repeat_emit_calcBlockSize ADDQ $0x05, AX JMP memmove_long_repeat_emit_calcBlockSize @@ -17215,7 +17329,7 @@ three_bytes_repeat_emit_calcBlockSize: two_bytes_repeat_emit_calcBlockSize: ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_calcBlockSize + JB memmove_repeat_emit_calcBlockSize JMP memmove_long_repeat_emit_calcBlockSize one_byte_repeat_emit_calcBlockSize: @@ -17240,7 +17354,7 @@ emit_literal_done_repeat_emit_calcBlockSize: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_calcBlockSize + JB matchlen_match4_repeat_extend_calcBlockSize matchlen_loopback_repeat_extend_calcBlockSize: MOVQ (R8)(R10*1), R9 @@ -17263,12 +17377,12 @@ matchlen_loop_repeat_extend_calcBlockSize: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_calcBlockSize + JAE matchlen_loopback_repeat_extend_calcBlockSize JZ repeat_extend_forward_end_calcBlockSize matchlen_match4_repeat_extend_calcBlockSize: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_calcBlockSize + JB matchlen_match2_repeat_extend_calcBlockSize MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_calcBlockSize @@ -17277,7 +17391,7 @@ matchlen_match4_repeat_extend_calcBlockSize: matchlen_match2_repeat_extend_calcBlockSize: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_calcBlockSize + JB matchlen_match1_repeat_extend_calcBlockSize MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_calcBlockSize @@ -17286,7 +17400,7 @@ matchlen_match2_repeat_extend_calcBlockSize: matchlen_match1_repeat_extend_calcBlockSize: CMPL DI, $0x01 - JL repeat_extend_forward_end_calcBlockSize + JB repeat_extend_forward_end_calcBlockSize MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_calcBlockSize @@ -17300,15 +17414,15 @@ repeat_extend_forward_end_calcBlockSize: // emitCopy CMPL SI, $0x00010000 - JL two_byte_offset_repeat_as_copy_calcBlockSize + JB two_byte_offset_repeat_as_copy_calcBlockSize four_bytes_loop_back_repeat_as_copy_calcBlockSize: CMPL BX, $0x40 - JLE four_bytes_remain_repeat_as_copy_calcBlockSize + JBE four_bytes_remain_repeat_as_copy_calcBlockSize LEAL -64(BX), BX ADDQ $0x05, AX CMPL BX, $0x04 - JL four_bytes_remain_repeat_as_copy_calcBlockSize + JB four_bytes_remain_repeat_as_copy_calcBlockSize JMP four_bytes_loop_back_repeat_as_copy_calcBlockSize four_bytes_remain_repeat_as_copy_calcBlockSize: @@ -17320,7 +17434,7 @@ four_bytes_remain_repeat_as_copy_calcBlockSize: two_byte_offset_repeat_as_copy_calcBlockSize: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_calcBlockSize + JBE two_byte_offset_short_repeat_as_copy_calcBlockSize LEAL -60(BX), BX ADDQ $0x03, AX JMP two_byte_offset_repeat_as_copy_calcBlockSize @@ -17329,9 +17443,9 @@ two_byte_offset_short_repeat_as_copy_calcBlockSize: MOVL BX, DI SHLL $0x02, DI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_calcBlockSize + JAE emit_copy_three_repeat_as_copy_calcBlockSize CMPL SI, $0x00000800 - JGE emit_copy_three_repeat_as_copy_calcBlockSize + JAE emit_copy_three_repeat_as_copy_calcBlockSize ADDQ $0x02, AX JMP repeat_end_emit_calcBlockSize @@ -17373,7 +17487,7 @@ candidate_match_calcBlockSize: match_extend_back_loop_calcBlockSize: CMPL CX, SI - JLE match_extend_back_end_calcBlockSize + JBE match_extend_back_end_calcBlockSize MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -17388,7 +17502,7 @@ match_extend_back_end_calcBlockSize: SUBL 12(SP), SI LEAQ 5(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_calcBlockSize + JB match_dst_size_check_calcBlockSize MOVQ $0x00000000, ret+24(FP) RET @@ -17403,13 +17517,13 @@ match_dst_size_check_calcBlockSize: SUBL DI, R8 LEAL -1(R8), SI CMPL SI, $0x3c - JLT one_byte_match_emit_calcBlockSize + JB one_byte_match_emit_calcBlockSize CMPL SI, $0x00000100 - JLT two_bytes_match_emit_calcBlockSize + JB two_bytes_match_emit_calcBlockSize CMPL SI, $0x00010000 - JLT three_bytes_match_emit_calcBlockSize + JB three_bytes_match_emit_calcBlockSize CMPL SI, $0x01000000 - JLT four_bytes_match_emit_calcBlockSize + JB four_bytes_match_emit_calcBlockSize ADDQ $0x05, AX JMP memmove_long_match_emit_calcBlockSize @@ -17424,7 +17538,7 @@ three_bytes_match_emit_calcBlockSize: two_bytes_match_emit_calcBlockSize: ADDQ $0x02, AX CMPL SI, $0x40 - JL memmove_match_emit_calcBlockSize + JB memmove_match_emit_calcBlockSize JMP memmove_long_match_emit_calcBlockSize one_byte_match_emit_calcBlockSize: @@ -17452,7 +17566,7 @@ match_nolit_loop_calcBlockSize: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_calcBlockSize + JB matchlen_match4_match_nolit_calcBlockSize matchlen_loopback_match_nolit_calcBlockSize: MOVQ (DI)(R9*1), R8 @@ -17475,12 +17589,12 @@ matchlen_loop_match_nolit_calcBlockSize: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_calcBlockSize + JAE matchlen_loopback_match_nolit_calcBlockSize JZ match_nolit_end_calcBlockSize matchlen_match4_match_nolit_calcBlockSize: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_calcBlockSize + JB matchlen_match2_match_nolit_calcBlockSize MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_calcBlockSize @@ -17489,7 +17603,7 @@ matchlen_match4_match_nolit_calcBlockSize: matchlen_match2_match_nolit_calcBlockSize: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_calcBlockSize + JB matchlen_match1_match_nolit_calcBlockSize MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_calcBlockSize @@ -17498,7 +17612,7 @@ matchlen_match2_match_nolit_calcBlockSize: matchlen_match1_match_nolit_calcBlockSize: CMPL SI, $0x01 - JL match_nolit_end_calcBlockSize + JB match_nolit_end_calcBlockSize MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_calcBlockSize @@ -17512,15 +17626,15 @@ match_nolit_end_calcBlockSize: // emitCopy CMPL BX, $0x00010000 - JL two_byte_offset_match_nolit_calcBlockSize + JB two_byte_offset_match_nolit_calcBlockSize four_bytes_loop_back_match_nolit_calcBlockSize: CMPL R9, $0x40 - JLE four_bytes_remain_match_nolit_calcBlockSize + JBE four_bytes_remain_match_nolit_calcBlockSize LEAL -64(R9), R9 ADDQ $0x05, AX CMPL R9, $0x04 - JL four_bytes_remain_match_nolit_calcBlockSize + JB four_bytes_remain_match_nolit_calcBlockSize JMP four_bytes_loop_back_match_nolit_calcBlockSize four_bytes_remain_match_nolit_calcBlockSize: @@ -17532,7 +17646,7 @@ four_bytes_remain_match_nolit_calcBlockSize: two_byte_offset_match_nolit_calcBlockSize: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_calcBlockSize + JBE two_byte_offset_short_match_nolit_calcBlockSize LEAL -60(R9), R9 ADDQ $0x03, AX JMP two_byte_offset_match_nolit_calcBlockSize @@ -17541,9 +17655,9 @@ two_byte_offset_short_match_nolit_calcBlockSize: MOVL R9, SI SHLL $0x02, SI CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_calcBlockSize + JAE emit_copy_three_match_nolit_calcBlockSize CMPL BX, $0x00000800 - JGE emit_copy_three_match_nolit_calcBlockSize + JAE emit_copy_three_match_nolit_calcBlockSize ADDQ $0x02, AX JMP match_nolit_emitcopy_end_calcBlockSize @@ -17552,10 +17666,10 @@ emit_copy_three_match_nolit_calcBlockSize: match_nolit_emitcopy_end_calcBlockSize: CMPL CX, 8(SP) - JGE emit_remainder_calcBlockSize + JAE emit_remainder_calcBlockSize MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_calcBlockSize + JB match_nolit_dst_ok_calcBlockSize MOVQ $0x00000000, ret+24(FP) RET @@ -17585,7 +17699,7 @@ emit_remainder_calcBlockSize: SUBL 12(SP), CX LEAQ 5(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_calcBlockSize + JB emit_remainder_ok_calcBlockSize MOVQ $0x00000000, ret+24(FP) RET @@ -17600,13 +17714,13 @@ emit_remainder_ok_calcBlockSize: SUBL BX, SI LEAL -1(SI), CX CMPL CX, $0x3c - JLT one_byte_emit_remainder_calcBlockSize + JB one_byte_emit_remainder_calcBlockSize CMPL CX, $0x00000100 - JLT two_bytes_emit_remainder_calcBlockSize + JB two_bytes_emit_remainder_calcBlockSize CMPL CX, $0x00010000 - JLT three_bytes_emit_remainder_calcBlockSize + JB three_bytes_emit_remainder_calcBlockSize CMPL CX, $0x01000000 - JLT four_bytes_emit_remainder_calcBlockSize + JB four_bytes_emit_remainder_calcBlockSize ADDQ $0x05, AX JMP memmove_long_emit_remainder_calcBlockSize @@ -17621,7 +17735,7 @@ three_bytes_emit_remainder_calcBlockSize: two_bytes_emit_remainder_calcBlockSize: ADDQ $0x02, AX CMPL CX, $0x40 - JL memmove_emit_remainder_calcBlockSize + JB memmove_emit_remainder_calcBlockSize JMP memmove_long_emit_remainder_calcBlockSize one_byte_emit_remainder_calcBlockSize: @@ -17677,7 +17791,7 @@ search_loop_calcBlockSizeSmall: SHRL $0x04, BX LEAL 4(CX)(BX*1), BX CMPL BX, 8(SP) - JGE emit_remainder_calcBlockSizeSmall + JAE emit_remainder_calcBlockSizeSmall MOVQ (DX)(CX*1), SI MOVL BX, 20(SP) MOVQ $0x9e3779b1, R8 @@ -17715,7 +17829,7 @@ search_loop_calcBlockSizeSmall: repeat_extend_back_loop_calcBlockSizeSmall: CMPL SI, BX - JLE repeat_extend_back_end_calcBlockSizeSmall + JBE repeat_extend_back_end_calcBlockSizeSmall MOVB -1(DX)(DI*1), R8 MOVB -1(DX)(SI*1), R9 CMPB R8, R9 @@ -17734,16 +17848,19 @@ repeat_extend_back_end_calcBlockSizeSmall: SUBL BX, DI LEAL -1(DI), BX CMPL BX, $0x3c - JLT one_byte_repeat_emit_calcBlockSizeSmall + JB one_byte_repeat_emit_calcBlockSizeSmall CMPL BX, $0x00000100 - JLT two_bytes_repeat_emit_calcBlockSizeSmall + JB two_bytes_repeat_emit_calcBlockSizeSmall + JB three_bytes_repeat_emit_calcBlockSizeSmall + +three_bytes_repeat_emit_calcBlockSizeSmall: ADDQ $0x03, AX JMP memmove_long_repeat_emit_calcBlockSizeSmall two_bytes_repeat_emit_calcBlockSizeSmall: ADDQ $0x02, AX CMPL BX, $0x40 - JL memmove_repeat_emit_calcBlockSizeSmall + JB memmove_repeat_emit_calcBlockSizeSmall JMP memmove_long_repeat_emit_calcBlockSizeSmall one_byte_repeat_emit_calcBlockSizeSmall: @@ -17768,7 +17885,7 @@ emit_literal_done_repeat_emit_calcBlockSizeSmall: // matchLen XORL R10, R10 CMPL DI, $0x08 - JL matchlen_match4_repeat_extend_calcBlockSizeSmall + JB matchlen_match4_repeat_extend_calcBlockSizeSmall matchlen_loopback_repeat_extend_calcBlockSizeSmall: MOVQ (R8)(R10*1), R9 @@ -17791,12 +17908,12 @@ matchlen_loop_repeat_extend_calcBlockSizeSmall: LEAL -8(DI), DI LEAL 8(R10), R10 CMPL DI, $0x08 - JGE matchlen_loopback_repeat_extend_calcBlockSizeSmall + JAE matchlen_loopback_repeat_extend_calcBlockSizeSmall JZ repeat_extend_forward_end_calcBlockSizeSmall matchlen_match4_repeat_extend_calcBlockSizeSmall: CMPL DI, $0x04 - JL matchlen_match2_repeat_extend_calcBlockSizeSmall + JB matchlen_match2_repeat_extend_calcBlockSizeSmall MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_calcBlockSizeSmall @@ -17805,7 +17922,7 @@ matchlen_match4_repeat_extend_calcBlockSizeSmall: matchlen_match2_repeat_extend_calcBlockSizeSmall: CMPL DI, $0x02 - JL matchlen_match1_repeat_extend_calcBlockSizeSmall + JB matchlen_match1_repeat_extend_calcBlockSizeSmall MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_calcBlockSizeSmall @@ -17814,7 +17931,7 @@ matchlen_match2_repeat_extend_calcBlockSizeSmall: matchlen_match1_repeat_extend_calcBlockSizeSmall: CMPL DI, $0x01 - JL repeat_extend_forward_end_calcBlockSizeSmall + JB repeat_extend_forward_end_calcBlockSizeSmall MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_calcBlockSizeSmall @@ -17829,7 +17946,7 @@ repeat_extend_forward_end_calcBlockSizeSmall: // emitCopy two_byte_offset_repeat_as_copy_calcBlockSizeSmall: CMPL BX, $0x40 - JLE two_byte_offset_short_repeat_as_copy_calcBlockSizeSmall + JBE two_byte_offset_short_repeat_as_copy_calcBlockSizeSmall LEAL -60(BX), BX ADDQ $0x03, AX JMP two_byte_offset_repeat_as_copy_calcBlockSizeSmall @@ -17838,7 +17955,7 @@ two_byte_offset_short_repeat_as_copy_calcBlockSizeSmall: MOVL BX, SI SHLL $0x02, SI CMPL BX, $0x0c - JGE emit_copy_three_repeat_as_copy_calcBlockSizeSmall + JAE emit_copy_three_repeat_as_copy_calcBlockSizeSmall ADDQ $0x02, AX JMP repeat_end_emit_calcBlockSizeSmall @@ -17880,7 +17997,7 @@ candidate_match_calcBlockSizeSmall: match_extend_back_loop_calcBlockSizeSmall: CMPL CX, SI - JLE match_extend_back_end_calcBlockSizeSmall + JBE match_extend_back_end_calcBlockSizeSmall MOVB -1(DX)(BX*1), DI MOVB -1(DX)(CX*1), R8 CMPB DI, R8 @@ -17895,7 +18012,7 @@ match_extend_back_end_calcBlockSizeSmall: SUBL 12(SP), SI LEAQ 3(AX)(SI*1), SI CMPQ SI, (SP) - JL match_dst_size_check_calcBlockSizeSmall + JB match_dst_size_check_calcBlockSizeSmall MOVQ $0x00000000, ret+24(FP) RET @@ -17910,16 +18027,19 @@ match_dst_size_check_calcBlockSizeSmall: SUBL DI, R8 LEAL -1(R8), SI CMPL SI, $0x3c - JLT one_byte_match_emit_calcBlockSizeSmall + JB one_byte_match_emit_calcBlockSizeSmall CMPL SI, $0x00000100 - JLT two_bytes_match_emit_calcBlockSizeSmall + JB two_bytes_match_emit_calcBlockSizeSmall + JB three_bytes_match_emit_calcBlockSizeSmall + +three_bytes_match_emit_calcBlockSizeSmall: ADDQ $0x03, AX JMP memmove_long_match_emit_calcBlockSizeSmall two_bytes_match_emit_calcBlockSizeSmall: ADDQ $0x02, AX CMPL SI, $0x40 - JL memmove_match_emit_calcBlockSizeSmall + JB memmove_match_emit_calcBlockSizeSmall JMP memmove_long_match_emit_calcBlockSizeSmall one_byte_match_emit_calcBlockSizeSmall: @@ -17947,7 +18067,7 @@ match_nolit_loop_calcBlockSizeSmall: // matchLen XORL R9, R9 CMPL SI, $0x08 - JL matchlen_match4_match_nolit_calcBlockSizeSmall + JB matchlen_match4_match_nolit_calcBlockSizeSmall matchlen_loopback_match_nolit_calcBlockSizeSmall: MOVQ (DI)(R9*1), R8 @@ -17970,12 +18090,12 @@ matchlen_loop_match_nolit_calcBlockSizeSmall: LEAL -8(SI), SI LEAL 8(R9), R9 CMPL SI, $0x08 - JGE matchlen_loopback_match_nolit_calcBlockSizeSmall + JAE matchlen_loopback_match_nolit_calcBlockSizeSmall JZ match_nolit_end_calcBlockSizeSmall matchlen_match4_match_nolit_calcBlockSizeSmall: CMPL SI, $0x04 - JL matchlen_match2_match_nolit_calcBlockSizeSmall + JB matchlen_match2_match_nolit_calcBlockSizeSmall MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_calcBlockSizeSmall @@ -17984,7 +18104,7 @@ matchlen_match4_match_nolit_calcBlockSizeSmall: matchlen_match2_match_nolit_calcBlockSizeSmall: CMPL SI, $0x02 - JL matchlen_match1_match_nolit_calcBlockSizeSmall + JB matchlen_match1_match_nolit_calcBlockSizeSmall MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_calcBlockSizeSmall @@ -17993,7 +18113,7 @@ matchlen_match2_match_nolit_calcBlockSizeSmall: matchlen_match1_match_nolit_calcBlockSizeSmall: CMPL SI, $0x01 - JL match_nolit_end_calcBlockSizeSmall + JB match_nolit_end_calcBlockSizeSmall MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_calcBlockSizeSmall @@ -18008,7 +18128,7 @@ match_nolit_end_calcBlockSizeSmall: // emitCopy two_byte_offset_match_nolit_calcBlockSizeSmall: CMPL R9, $0x40 - JLE two_byte_offset_short_match_nolit_calcBlockSizeSmall + JBE two_byte_offset_short_match_nolit_calcBlockSizeSmall LEAL -60(R9), R9 ADDQ $0x03, AX JMP two_byte_offset_match_nolit_calcBlockSizeSmall @@ -18017,7 +18137,7 @@ two_byte_offset_short_match_nolit_calcBlockSizeSmall: MOVL R9, BX SHLL $0x02, BX CMPL R9, $0x0c - JGE emit_copy_three_match_nolit_calcBlockSizeSmall + JAE emit_copy_three_match_nolit_calcBlockSizeSmall ADDQ $0x02, AX JMP match_nolit_emitcopy_end_calcBlockSizeSmall @@ -18026,10 +18146,10 @@ emit_copy_three_match_nolit_calcBlockSizeSmall: match_nolit_emitcopy_end_calcBlockSizeSmall: CMPL CX, 8(SP) - JGE emit_remainder_calcBlockSizeSmall + JAE emit_remainder_calcBlockSizeSmall MOVQ -2(DX)(CX*1), SI CMPQ AX, (SP) - JL match_nolit_dst_ok_calcBlockSizeSmall + JB match_nolit_dst_ok_calcBlockSizeSmall MOVQ $0x00000000, ret+24(FP) RET @@ -18059,7 +18179,7 @@ emit_remainder_calcBlockSizeSmall: SUBL 12(SP), CX LEAQ 3(AX)(CX*1), CX CMPQ CX, (SP) - JL emit_remainder_ok_calcBlockSizeSmall + JB emit_remainder_ok_calcBlockSizeSmall MOVQ $0x00000000, ret+24(FP) RET @@ -18074,16 +18194,19 @@ emit_remainder_ok_calcBlockSizeSmall: SUBL BX, SI LEAL -1(SI), CX CMPL CX, $0x3c - JLT one_byte_emit_remainder_calcBlockSizeSmall + JB one_byte_emit_remainder_calcBlockSizeSmall CMPL CX, $0x00000100 - JLT two_bytes_emit_remainder_calcBlockSizeSmall + JB two_bytes_emit_remainder_calcBlockSizeSmall + JB three_bytes_emit_remainder_calcBlockSizeSmall + +three_bytes_emit_remainder_calcBlockSizeSmall: ADDQ $0x03, AX JMP memmove_long_emit_remainder_calcBlockSizeSmall two_bytes_emit_remainder_calcBlockSizeSmall: ADDQ $0x02, AX CMPL CX, $0x40 - JL memmove_emit_remainder_calcBlockSizeSmall + JB memmove_emit_remainder_calcBlockSizeSmall JMP memmove_long_emit_remainder_calcBlockSizeSmall one_byte_emit_remainder_calcBlockSizeSmall: @@ -18111,13 +18234,13 @@ TEXT ·emitLiteral(SB), NOSPLIT, $0-56 MOVL DX, BX LEAL -1(DX), SI CMPL SI, $0x3c - JLT one_byte_standalone + JB one_byte_standalone CMPL SI, $0x00000100 - JLT two_bytes_standalone + JB two_bytes_standalone CMPL SI, $0x00010000 - JLT three_bytes_standalone + JB three_bytes_standalone CMPL SI, $0x01000000 - JLT four_bytes_standalone + JB four_bytes_standalone MOVB $0xfc, (AX) MOVL SI, 1(AX) ADDQ $0x05, BX @@ -18147,7 +18270,7 @@ two_bytes_standalone: ADDQ $0x02, BX ADDQ $0x02, AX CMPL SI, $0x40 - JL memmove_standalone + JB memmove_standalone JMP memmove_long_standalone one_byte_standalone: @@ -18278,19 +18401,19 @@ emit_repeat_again_standalone: MOVL DX, SI LEAL -4(DX), DX CMPL SI, $0x08 - JLE repeat_two_standalone + JBE repeat_two_standalone CMPL SI, $0x0c - JGE cant_repeat_two_offset_standalone + JAE cant_repeat_two_offset_standalone CMPL CX, $0x00000800 - JLT repeat_two_offset_standalone + JB repeat_two_offset_standalone cant_repeat_two_offset_standalone: CMPL DX, $0x00000104 - JLT repeat_three_standalone + JB repeat_three_standalone CMPL DX, $0x00010100 - JLT repeat_four_standalone + JB repeat_four_standalone CMPL DX, $0x0100ffff - JLT repeat_five_standalone + JB repeat_five_standalone LEAL -16842747(DX), DX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -18357,35 +18480,35 @@ TEXT ·emitCopy(SB), NOSPLIT, $0-48 // emitCopy CMPL CX, $0x00010000 - JL two_byte_offset_standalone + JB two_byte_offset_standalone CMPL DX, $0x40 - JLE four_bytes_remain_standalone + JBE four_bytes_remain_standalone MOVB $0xff, (AX) MOVL CX, 1(AX) LEAL -64(DX), DX ADDQ $0x05, BX ADDQ $0x05, AX CMPL DX, $0x04 - JL four_bytes_remain_standalone + JB four_bytes_remain_standalone // emitRepeat emit_repeat_again_standalone_emit_copy: MOVL DX, SI LEAL -4(DX), DX CMPL SI, $0x08 - JLE repeat_two_standalone_emit_copy + JBE repeat_two_standalone_emit_copy CMPL SI, $0x0c - JGE cant_repeat_two_offset_standalone_emit_copy + JAE cant_repeat_two_offset_standalone_emit_copy CMPL CX, $0x00000800 - JLT repeat_two_offset_standalone_emit_copy + JB repeat_two_offset_standalone_emit_copy cant_repeat_two_offset_standalone_emit_copy: CMPL DX, $0x00000104 - JLT repeat_three_standalone_emit_copy + JB repeat_three_standalone_emit_copy CMPL DX, $0x00010100 - JLT repeat_four_standalone_emit_copy + JB repeat_four_standalone_emit_copy CMPL DX, $0x0100ffff - JLT repeat_five_standalone_emit_copy + JB repeat_five_standalone_emit_copy LEAL -16842747(DX), DX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -18453,7 +18576,7 @@ four_bytes_remain_standalone: two_byte_offset_standalone: CMPL DX, $0x40 - JLE two_byte_offset_short_standalone + JBE two_byte_offset_short_standalone CMPL CX, $0x00000800 JAE long_offset_short_standalone MOVL $0x00000001, SI @@ -18476,19 +18599,19 @@ emit_repeat_again_standalone_emit_copy_short_2b: MOVL DX, SI LEAL -4(DX), DX CMPL SI, $0x08 - JLE repeat_two_standalone_emit_copy_short_2b + JBE repeat_two_standalone_emit_copy_short_2b CMPL SI, $0x0c - JGE cant_repeat_two_offset_standalone_emit_copy_short_2b + JAE cant_repeat_two_offset_standalone_emit_copy_short_2b CMPL CX, $0x00000800 - JLT repeat_two_offset_standalone_emit_copy_short_2b + JB repeat_two_offset_standalone_emit_copy_short_2b cant_repeat_two_offset_standalone_emit_copy_short_2b: CMPL DX, $0x00000104 - JLT repeat_three_standalone_emit_copy_short_2b + JB repeat_three_standalone_emit_copy_short_2b CMPL DX, $0x00010100 - JLT repeat_four_standalone_emit_copy_short_2b + JB repeat_four_standalone_emit_copy_short_2b CMPL DX, $0x0100ffff - JLT repeat_five_standalone_emit_copy_short_2b + JB repeat_five_standalone_emit_copy_short_2b LEAL -16842747(DX), DX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -18555,19 +18678,19 @@ emit_repeat_again_standalone_emit_copy_short: MOVL DX, SI LEAL -4(DX), DX CMPL SI, $0x08 - JLE repeat_two_standalone_emit_copy_short + JBE repeat_two_standalone_emit_copy_short CMPL SI, $0x0c - JGE cant_repeat_two_offset_standalone_emit_copy_short + JAE cant_repeat_two_offset_standalone_emit_copy_short CMPL CX, $0x00000800 - JLT repeat_two_offset_standalone_emit_copy_short + JB repeat_two_offset_standalone_emit_copy_short cant_repeat_two_offset_standalone_emit_copy_short: CMPL DX, $0x00000104 - JLT repeat_three_standalone_emit_copy_short + JB repeat_three_standalone_emit_copy_short CMPL DX, $0x00010100 - JLT repeat_four_standalone_emit_copy_short + JB repeat_four_standalone_emit_copy_short CMPL DX, $0x0100ffff - JLT repeat_five_standalone_emit_copy_short + JB repeat_five_standalone_emit_copy_short LEAL -16842747(DX), DX MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -18626,9 +18749,9 @@ two_byte_offset_short_standalone: MOVL DX, SI SHLL $0x02, SI CMPL DX, $0x0c - JGE emit_copy_three_standalone + JAE emit_copy_three_standalone CMPL CX, $0x00000800 - JGE emit_copy_three_standalone + JAE emit_copy_three_standalone LEAL -15(SI), SI MOVB CL, 1(AX) SHRL $0x08, CX @@ -18659,18 +18782,18 @@ TEXT ·emitCopyNoRepeat(SB), NOSPLIT, $0-48 // emitCopy CMPL CX, $0x00010000 - JL two_byte_offset_standalone_snappy + JB two_byte_offset_standalone_snappy four_bytes_loop_back_standalone_snappy: CMPL DX, $0x40 - JLE four_bytes_remain_standalone_snappy + JBE four_bytes_remain_standalone_snappy MOVB $0xff, (AX) MOVL CX, 1(AX) LEAL -64(DX), DX ADDQ $0x05, BX ADDQ $0x05, AX CMPL DX, $0x04 - JL four_bytes_remain_standalone_snappy + JB four_bytes_remain_standalone_snappy JMP four_bytes_loop_back_standalone_snappy four_bytes_remain_standalone_snappy: @@ -18686,7 +18809,7 @@ four_bytes_remain_standalone_snappy: two_byte_offset_standalone_snappy: CMPL DX, $0x40 - JLE two_byte_offset_short_standalone_snappy + JBE two_byte_offset_short_standalone_snappy MOVB $0xee, (AX) MOVW CX, 1(AX) LEAL -60(DX), DX @@ -18698,9 +18821,9 @@ two_byte_offset_short_standalone_snappy: MOVL DX, SI SHLL $0x02, SI CMPL DX, $0x0c - JGE emit_copy_three_standalone_snappy + JAE emit_copy_three_standalone_snappy CMPL CX, $0x00000800 - JGE emit_copy_three_standalone_snappy + JAE emit_copy_three_standalone_snappy LEAL -15(SI), SI MOVB CL, 1(AX) SHRL $0x08, CX @@ -18732,7 +18855,7 @@ TEXT ·matchLen(SB), NOSPLIT, $0-56 // matchLen XORL SI, SI CMPL DX, $0x08 - JL matchlen_match4_standalone + JB matchlen_match4_standalone matchlen_loopback_standalone: MOVQ (AX)(SI*1), BX @@ -18755,12 +18878,12 @@ matchlen_loop_standalone: LEAL -8(DX), DX LEAL 8(SI), SI CMPL DX, $0x08 - JGE matchlen_loopback_standalone + JAE matchlen_loopback_standalone JZ gen_match_len_end matchlen_match4_standalone: CMPL DX, $0x04 - JL matchlen_match2_standalone + JB matchlen_match2_standalone MOVL (AX)(SI*1), BX CMPL (CX)(SI*1), BX JNE matchlen_match2_standalone @@ -18769,7 +18892,7 @@ matchlen_match4_standalone: matchlen_match2_standalone: CMPL DX, $0x02 - JL matchlen_match1_standalone + JB matchlen_match1_standalone MOVW (AX)(SI*1), BX CMPW (CX)(SI*1), BX JNE matchlen_match1_standalone @@ -18778,7 +18901,7 @@ matchlen_match2_standalone: matchlen_match1_standalone: CMPL DX, $0x01 - JL gen_match_len_end + JB gen_match_len_end MOVB (AX)(SI*1), BL CMPB (CX)(SI*1), BL JNE gen_match_len_end @@ -18837,13 +18960,13 @@ lz4_s2_ll_end: ADDQ R9, SI LEAL -1(R9), R11 CMPL R11, $0x3c - JLT one_byte_lz4_s2 + JB one_byte_lz4_s2 CMPL R11, $0x00000100 - JLT two_bytes_lz4_s2 + JB two_bytes_lz4_s2 CMPL R11, $0x00010000 - JLT three_bytes_lz4_s2 + JB three_bytes_lz4_s2 CMPL R11, $0x01000000 - JLT four_bytes_lz4_s2 + JB four_bytes_lz4_s2 MOVB $0xfc, (AX) MOVL R11, 1(AX) ADDQ $0x05, AX @@ -18869,7 +18992,7 @@ two_bytes_lz4_s2: MOVB R11, 1(AX) ADDQ $0x02, AX CMPL R11, $0x40 - JL memmove_lz4_s2 + JB memmove_lz4_s2 JMP memmove_long_lz4_s2 one_byte_lz4_s2: @@ -18882,7 +19005,7 @@ memmove_lz4_s2: // genMemMoveShort CMPQ R9, $0x08 - JLE emit_lit_memmove_lz4_s2_memmove_move_8 + JBE emit_lit_memmove_lz4_s2_memmove_move_8 CMPQ R9, $0x10 JBE emit_lit_memmove_lz4_s2_memmove_move_8through16 CMPQ R9, $0x20 @@ -19008,19 +19131,19 @@ emit_repeat_again_lz4_s2: MOVL R10, R8 LEAL -4(R10), R10 CMPL R8, $0x08 - JLE repeat_two_lz4_s2 + JBE repeat_two_lz4_s2 CMPL R8, $0x0c - JGE cant_repeat_two_offset_lz4_s2 + JAE cant_repeat_two_offset_lz4_s2 CMPL R9, $0x00000800 - JLT repeat_two_offset_lz4_s2 + JB repeat_two_offset_lz4_s2 cant_repeat_two_offset_lz4_s2: CMPL R10, $0x00000104 - JLT repeat_three_lz4_s2 + JB repeat_three_lz4_s2 CMPL R10, $0x00010100 - JLT repeat_four_lz4_s2 + JB repeat_four_lz4_s2 CMPL R10, $0x0100ffff - JLT repeat_five_lz4_s2 + JB repeat_five_lz4_s2 LEAL -16842747(R10), R10 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -19074,7 +19197,7 @@ lz4_s2_docopy: // emitCopy CMPL R10, $0x40 - JLE two_byte_offset_short_lz4_s2 + JBE two_byte_offset_short_lz4_s2 CMPL R9, $0x00000800 JAE long_offset_short_lz4_s2 MOVL $0x00000001, R8 @@ -19096,19 +19219,19 @@ emit_repeat_again_lz4_s2_emit_copy_short_2b: MOVL R10, R8 LEAL -4(R10), R10 CMPL R8, $0x08 - JLE repeat_two_lz4_s2_emit_copy_short_2b + JBE repeat_two_lz4_s2_emit_copy_short_2b CMPL R8, $0x0c - JGE cant_repeat_two_offset_lz4_s2_emit_copy_short_2b + JAE cant_repeat_two_offset_lz4_s2_emit_copy_short_2b CMPL R9, $0x00000800 - JLT repeat_two_offset_lz4_s2_emit_copy_short_2b + JB repeat_two_offset_lz4_s2_emit_copy_short_2b cant_repeat_two_offset_lz4_s2_emit_copy_short_2b: CMPL R10, $0x00000104 - JLT repeat_three_lz4_s2_emit_copy_short_2b + JB repeat_three_lz4_s2_emit_copy_short_2b CMPL R10, $0x00010100 - JLT repeat_four_lz4_s2_emit_copy_short_2b + JB repeat_four_lz4_s2_emit_copy_short_2b CMPL R10, $0x0100ffff - JLT repeat_five_lz4_s2_emit_copy_short_2b + JB repeat_five_lz4_s2_emit_copy_short_2b LEAL -16842747(R10), R10 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -19168,19 +19291,19 @@ emit_repeat_again_lz4_s2_emit_copy_short: MOVL R10, R8 LEAL -4(R10), R10 CMPL R8, $0x08 - JLE repeat_two_lz4_s2_emit_copy_short + JBE repeat_two_lz4_s2_emit_copy_short CMPL R8, $0x0c - JGE cant_repeat_two_offset_lz4_s2_emit_copy_short + JAE cant_repeat_two_offset_lz4_s2_emit_copy_short CMPL R9, $0x00000800 - JLT repeat_two_offset_lz4_s2_emit_copy_short + JB repeat_two_offset_lz4_s2_emit_copy_short cant_repeat_two_offset_lz4_s2_emit_copy_short: CMPL R10, $0x00000104 - JLT repeat_three_lz4_s2_emit_copy_short + JB repeat_three_lz4_s2_emit_copy_short CMPL R10, $0x00010100 - JLT repeat_four_lz4_s2_emit_copy_short + JB repeat_four_lz4_s2_emit_copy_short CMPL R10, $0x0100ffff - JLT repeat_five_lz4_s2_emit_copy_short + JB repeat_five_lz4_s2_emit_copy_short LEAL -16842747(R10), R10 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -19233,9 +19356,9 @@ two_byte_offset_short_lz4_s2: MOVL R10, R8 SHLL $0x02, R8 CMPL R10, $0x0c - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 CMPL R9, $0x00000800 - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 LEAL -15(R8), R8 MOVB R9, 1(AX) SHRL $0x08, R9 @@ -19320,13 +19443,13 @@ lz4s_s2_ll_end: ADDQ R9, SI LEAL -1(R9), R11 CMPL R11, $0x3c - JLT one_byte_lz4s_s2 + JB one_byte_lz4s_s2 CMPL R11, $0x00000100 - JLT two_bytes_lz4s_s2 + JB two_bytes_lz4s_s2 CMPL R11, $0x00010000 - JLT three_bytes_lz4s_s2 + JB three_bytes_lz4s_s2 CMPL R11, $0x01000000 - JLT four_bytes_lz4s_s2 + JB four_bytes_lz4s_s2 MOVB $0xfc, (AX) MOVL R11, 1(AX) ADDQ $0x05, AX @@ -19352,7 +19475,7 @@ two_bytes_lz4s_s2: MOVB R11, 1(AX) ADDQ $0x02, AX CMPL R11, $0x40 - JL memmove_lz4s_s2 + JB memmove_lz4s_s2 JMP memmove_long_lz4s_s2 one_byte_lz4s_s2: @@ -19365,7 +19488,7 @@ memmove_lz4s_s2: // genMemMoveShort CMPQ R9, $0x08 - JLE emit_lit_memmove_lz4s_s2_memmove_move_8 + JBE emit_lit_memmove_lz4s_s2_memmove_move_8 CMPQ R9, $0x10 JBE emit_lit_memmove_lz4s_s2_memmove_move_8through16 CMPQ R9, $0x20 @@ -19493,19 +19616,19 @@ emit_repeat_again_lz4_s2: MOVL R10, R8 LEAL -4(R10), R10 CMPL R8, $0x08 - JLE repeat_two_lz4_s2 + JBE repeat_two_lz4_s2 CMPL R8, $0x0c - JGE cant_repeat_two_offset_lz4_s2 + JAE cant_repeat_two_offset_lz4_s2 CMPL R9, $0x00000800 - JLT repeat_two_offset_lz4_s2 + JB repeat_two_offset_lz4_s2 cant_repeat_two_offset_lz4_s2: CMPL R10, $0x00000104 - JLT repeat_three_lz4_s2 + JB repeat_three_lz4_s2 CMPL R10, $0x00010100 - JLT repeat_four_lz4_s2 + JB repeat_four_lz4_s2 CMPL R10, $0x0100ffff - JLT repeat_five_lz4_s2 + JB repeat_five_lz4_s2 LEAL -16842747(R10), R10 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -19559,7 +19682,7 @@ lz4s_s2_docopy: // emitCopy CMPL R10, $0x40 - JLE two_byte_offset_short_lz4_s2 + JBE two_byte_offset_short_lz4_s2 CMPL R9, $0x00000800 JAE long_offset_short_lz4_s2 MOVL $0x00000001, R8 @@ -19581,19 +19704,19 @@ emit_repeat_again_lz4_s2_emit_copy_short_2b: MOVL R10, R8 LEAL -4(R10), R10 CMPL R8, $0x08 - JLE repeat_two_lz4_s2_emit_copy_short_2b + JBE repeat_two_lz4_s2_emit_copy_short_2b CMPL R8, $0x0c - JGE cant_repeat_two_offset_lz4_s2_emit_copy_short_2b + JAE cant_repeat_two_offset_lz4_s2_emit_copy_short_2b CMPL R9, $0x00000800 - JLT repeat_two_offset_lz4_s2_emit_copy_short_2b + JB repeat_two_offset_lz4_s2_emit_copy_short_2b cant_repeat_two_offset_lz4_s2_emit_copy_short_2b: CMPL R10, $0x00000104 - JLT repeat_three_lz4_s2_emit_copy_short_2b + JB repeat_three_lz4_s2_emit_copy_short_2b CMPL R10, $0x00010100 - JLT repeat_four_lz4_s2_emit_copy_short_2b + JB repeat_four_lz4_s2_emit_copy_short_2b CMPL R10, $0x0100ffff - JLT repeat_five_lz4_s2_emit_copy_short_2b + JB repeat_five_lz4_s2_emit_copy_short_2b LEAL -16842747(R10), R10 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -19653,19 +19776,19 @@ emit_repeat_again_lz4_s2_emit_copy_short: MOVL R10, R8 LEAL -4(R10), R10 CMPL R8, $0x08 - JLE repeat_two_lz4_s2_emit_copy_short + JBE repeat_two_lz4_s2_emit_copy_short CMPL R8, $0x0c - JGE cant_repeat_two_offset_lz4_s2_emit_copy_short + JAE cant_repeat_two_offset_lz4_s2_emit_copy_short CMPL R9, $0x00000800 - JLT repeat_two_offset_lz4_s2_emit_copy_short + JB repeat_two_offset_lz4_s2_emit_copy_short cant_repeat_two_offset_lz4_s2_emit_copy_short: CMPL R10, $0x00000104 - JLT repeat_three_lz4_s2_emit_copy_short + JB repeat_three_lz4_s2_emit_copy_short CMPL R10, $0x00010100 - JLT repeat_four_lz4_s2_emit_copy_short + JB repeat_four_lz4_s2_emit_copy_short CMPL R10, $0x0100ffff - JLT repeat_five_lz4_s2_emit_copy_short + JB repeat_five_lz4_s2_emit_copy_short LEAL -16842747(R10), R10 MOVL $0xfffb001d, (AX) MOVB $0xff, 4(AX) @@ -19718,9 +19841,9 @@ two_byte_offset_short_lz4_s2: MOVL R10, R8 SHLL $0x02, R8 CMPL R10, $0x0c - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 CMPL R9, $0x00000800 - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 LEAL -15(R8), R8 MOVB R9, 1(AX) SHRL $0x08, R9 @@ -19804,13 +19927,13 @@ lz4_snappy_ll_end: ADDQ R8, SI LEAL -1(R8), R10 CMPL R10, $0x3c - JLT one_byte_lz4_snappy + JB one_byte_lz4_snappy CMPL R10, $0x00000100 - JLT two_bytes_lz4_snappy + JB two_bytes_lz4_snappy CMPL R10, $0x00010000 - JLT three_bytes_lz4_snappy + JB three_bytes_lz4_snappy CMPL R10, $0x01000000 - JLT four_bytes_lz4_snappy + JB four_bytes_lz4_snappy MOVB $0xfc, (AX) MOVL R10, 1(AX) ADDQ $0x05, AX @@ -19836,7 +19959,7 @@ two_bytes_lz4_snappy: MOVB R10, 1(AX) ADDQ $0x02, AX CMPL R10, $0x40 - JL memmove_lz4_snappy + JB memmove_lz4_snappy JMP memmove_long_lz4_snappy one_byte_lz4_snappy: @@ -19849,7 +19972,7 @@ memmove_lz4_snappy: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_lz4_snappy_memmove_move_8 + JBE emit_lit_memmove_lz4_snappy_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_lz4_snappy_memmove_move_8through16 CMPQ R8, $0x20 @@ -19971,7 +20094,7 @@ lz4_snappy_ml_done: // emitCopy two_byte_offset_lz4_s2: CMPL R9, $0x40 - JLE two_byte_offset_short_lz4_s2 + JBE two_byte_offset_short_lz4_s2 MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R9), R9 @@ -19984,9 +20107,9 @@ two_byte_offset_short_lz4_s2: MOVL R9, DI SHLL $0x02, DI CMPL R9, $0x0c - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 CMPL R8, $0x00000800 - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 LEAL -15(DI), DI MOVB R8, 1(AX) SHRL $0x08, R8 @@ -20070,13 +20193,13 @@ lz4s_snappy_ll_end: ADDQ R8, SI LEAL -1(R8), R10 CMPL R10, $0x3c - JLT one_byte_lz4s_snappy + JB one_byte_lz4s_snappy CMPL R10, $0x00000100 - JLT two_bytes_lz4s_snappy + JB two_bytes_lz4s_snappy CMPL R10, $0x00010000 - JLT three_bytes_lz4s_snappy + JB three_bytes_lz4s_snappy CMPL R10, $0x01000000 - JLT four_bytes_lz4s_snappy + JB four_bytes_lz4s_snappy MOVB $0xfc, (AX) MOVL R10, 1(AX) ADDQ $0x05, AX @@ -20102,7 +20225,7 @@ two_bytes_lz4s_snappy: MOVB R10, 1(AX) ADDQ $0x02, AX CMPL R10, $0x40 - JL memmove_lz4s_snappy + JB memmove_lz4s_snappy JMP memmove_long_lz4s_snappy one_byte_lz4s_snappy: @@ -20115,7 +20238,7 @@ memmove_lz4s_snappy: // genMemMoveShort CMPQ R8, $0x08 - JLE emit_lit_memmove_lz4s_snappy_memmove_move_8 + JBE emit_lit_memmove_lz4s_snappy_memmove_move_8 CMPQ R8, $0x10 JBE emit_lit_memmove_lz4s_snappy_memmove_move_8through16 CMPQ R8, $0x20 @@ -20239,7 +20362,7 @@ lz4s_snappy_ml_done: // emitCopy two_byte_offset_lz4_s2: CMPL R9, $0x40 - JLE two_byte_offset_short_lz4_s2 + JBE two_byte_offset_short_lz4_s2 MOVB $0xee, (AX) MOVW R8, 1(AX) LEAL -60(R9), R9 @@ -20252,9 +20375,9 @@ two_byte_offset_short_lz4_s2: MOVL R9, DI SHLL $0x02, DI CMPL R9, $0x0c - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 CMPL R8, $0x00000800 - JGE emit_copy_three_lz4_s2 + JAE emit_copy_three_lz4_s2 LEAL -15(DI), DI MOVB R8, 1(AX) SHRL $0x08, R8 diff --git a/vendor/github.com/klauspost/compress/s2/reader.go b/vendor/github.com/klauspost/compress/s2/reader.go new file mode 100644 index 000000000..8b84baa6d --- /dev/null +++ b/vendor/github.com/klauspost/compress/s2/reader.go @@ -0,0 +1,1055 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Copyright (c) 2019+ Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package s2 + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "runtime" + "sync" +) + +// ErrCantSeek is returned if the stream cannot be seeked. +type ErrCantSeek struct { + Reason string +} + +// Error returns the error as string. +func (e ErrCantSeek) Error() string { + return fmt.Sprintf("s2: Can't seek because %s", e.Reason) +} + +// NewReader returns a new Reader that decompresses from r, using the framing +// format described at +// https://github.com/google/snappy/blob/master/framing_format.txt with S2 changes. +func NewReader(r io.Reader, opts ...ReaderOption) *Reader { + nr := Reader{ + r: r, + maxBlock: maxBlockSize, + } + for _, opt := range opts { + if err := opt(&nr); err != nil { + nr.err = err + return &nr + } + } + nr.maxBufSize = MaxEncodedLen(nr.maxBlock) + checksumSize + if nr.lazyBuf > 0 { + nr.buf = make([]byte, MaxEncodedLen(nr.lazyBuf)+checksumSize) + } else { + nr.buf = make([]byte, MaxEncodedLen(defaultBlockSize)+checksumSize) + } + nr.readHeader = nr.ignoreStreamID + nr.paramsOK = true + return &nr +} + +// ReaderOption is an option for creating a decoder. +type ReaderOption func(*Reader) error + +// ReaderMaxBlockSize allows to control allocations if the stream +// has been compressed with a smaller WriterBlockSize, or with the default 1MB. +// Blocks must be this size or smaller to decompress, +// otherwise the decoder will return ErrUnsupported. +// +// For streams compressed with Snappy this can safely be set to 64KB (64 << 10). +// +// Default is the maximum limit of 4MB. +func ReaderMaxBlockSize(blockSize int) ReaderOption { + return func(r *Reader) error { + if blockSize > maxBlockSize || blockSize <= 0 { + return errors.New("s2: block size too large. Must be <= 4MB and > 0") + } + if r.lazyBuf == 0 && blockSize < defaultBlockSize { + r.lazyBuf = blockSize + } + r.maxBlock = blockSize + return nil + } +} + +// ReaderAllocBlock allows to control upfront stream allocations +// and not allocate for frames bigger than this initially. +// If frames bigger than this is seen a bigger buffer will be allocated. +// +// Default is 1MB, which is default output size. +func ReaderAllocBlock(blockSize int) ReaderOption { + return func(r *Reader) error { + if blockSize > maxBlockSize || blockSize < 1024 { + return errors.New("s2: invalid ReaderAllocBlock. Must be <= 4MB and >= 1024") + } + r.lazyBuf = blockSize + return nil + } +} + +// ReaderIgnoreStreamIdentifier will make the reader skip the expected +// stream identifier at the beginning of the stream. +// This can be used when serving a stream that has been forwarded to a specific point. +func ReaderIgnoreStreamIdentifier() ReaderOption { + return func(r *Reader) error { + r.ignoreStreamID = true + return nil + } +} + +// ReaderSkippableCB will register a callback for chuncks with the specified ID. +// ID must be a Reserved skippable chunks ID, 0x80-0xfd (inclusive). +// For each chunk with the ID, the callback is called with the content. +// Any returned non-nil error will abort decompression. +// Only one callback per ID is supported, latest sent will be used. +func ReaderSkippableCB(id uint8, fn func(r io.Reader) error) ReaderOption { + return func(r *Reader) error { + if id < 0x80 || id > 0xfd { + return fmt.Errorf("ReaderSkippableCB: Invalid id provided, must be 0x80-0xfd (inclusive)") + } + r.skippableCB[id] = fn + return nil + } +} + +// ReaderIgnoreCRC will make the reader skip CRC calculation and checks. +func ReaderIgnoreCRC() ReaderOption { + return func(r *Reader) error { + r.ignoreCRC = true + return nil + } +} + +// Reader is an io.Reader that can read Snappy-compressed bytes. +type Reader struct { + r io.Reader + err error + decoded []byte + buf []byte + skippableCB [0x80]func(r io.Reader) error + blockStart int64 // Uncompressed offset at start of current. + index *Index + + // decoded[i:j] contains decoded bytes that have not yet been passed on. + i, j int + // maximum block size allowed. + maxBlock int + // maximum expected buffer size. + maxBufSize int + // alloc a buffer this size if > 0. + lazyBuf int + readHeader bool + paramsOK bool + snappyFrame bool + ignoreStreamID bool + ignoreCRC bool +} + +// ensureBufferSize will ensure that the buffer can take at least n bytes. +// If false is returned the buffer exceeds maximum allowed size. +func (r *Reader) ensureBufferSize(n int) bool { + if n > r.maxBufSize { + r.err = ErrCorrupt + return false + } + if cap(r.buf) >= n { + return true + } + // Realloc buffer. + r.buf = make([]byte, n) + return true +} + +// Reset discards any buffered data, resets all state, and switches the Snappy +// reader to read from r. This permits reusing a Reader rather than allocating +// a new one. +func (r *Reader) Reset(reader io.Reader) { + if !r.paramsOK { + return + } + r.index = nil + r.r = reader + r.err = nil + r.i = 0 + r.j = 0 + r.blockStart = 0 + r.readHeader = r.ignoreStreamID +} + +func (r *Reader) readFull(p []byte, allowEOF bool) (ok bool) { + if _, r.err = io.ReadFull(r.r, p); r.err != nil { + if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrCorrupt + } + return false + } + return true +} + +// skippable will skip n bytes. +// If the supplied reader supports seeking that is used. +// tmp is used as a temporary buffer for reading. +// The supplied slice does not need to be the size of the read. +func (r *Reader) skippable(tmp []byte, n int, allowEOF bool, id uint8) (ok bool) { + if id < 0x80 { + r.err = fmt.Errorf("interbal error: skippable id < 0x80") + return false + } + if fn := r.skippableCB[id-0x80]; fn != nil { + rd := io.LimitReader(r.r, int64(n)) + r.err = fn(rd) + if r.err != nil { + return false + } + _, r.err = io.CopyBuffer(ioutil.Discard, rd, tmp) + return r.err == nil + } + if rs, ok := r.r.(io.ReadSeeker); ok { + _, err := rs.Seek(int64(n), io.SeekCurrent) + if err == nil { + return true + } + if err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrCorrupt + return false + } + } + for n > 0 { + if n < len(tmp) { + tmp = tmp[:n] + } + if _, r.err = io.ReadFull(r.r, tmp); r.err != nil { + if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrCorrupt + } + return false + } + n -= len(tmp) + } + return true +} + +// Read satisfies the io.Reader interface. +func (r *Reader) Read(p []byte) (int, error) { + if r.err != nil { + return 0, r.err + } + for { + if r.i < r.j { + n := copy(p, r.decoded[r.i:r.j]) + r.i += n + return n, nil + } + if !r.readFull(r.buf[:4], true) { + return 0, r.err + } + chunkType := r.buf[0] + if !r.readHeader { + if chunkType != chunkTypeStreamIdentifier { + r.err = ErrCorrupt + return 0, r.err + } + r.readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + r.blockStart += int64(r.j) + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + if !r.ensureBufferSize(chunkLen) { + if r.err == nil { + r.err = ErrUnsupported + } + return 0, r.err + } + buf := r.buf[:chunkLen] + if !r.readFull(buf, false) { + return 0, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[checksumSize:] + + n, err := DecodedLen(buf) + if err != nil { + r.err = err + return 0, r.err + } + if r.snappyFrame && n > maxSnappyBlockSize { + r.err = ErrCorrupt + return 0, r.err + } + + if n > len(r.decoded) { + if n > r.maxBlock { + r.err = ErrCorrupt + return 0, r.err + } + r.decoded = make([]byte, n) + } + if _, err := Decode(r.decoded, buf); err != nil { + r.err = err + return 0, r.err + } + if !r.ignoreCRC && crc(r.decoded[:n]) != checksum { + r.err = ErrCRC + return 0, r.err + } + r.i, r.j = 0, n + continue + + case chunkTypeUncompressedData: + r.blockStart += int64(r.j) + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + if !r.ensureBufferSize(chunkLen) { + if r.err == nil { + r.err = ErrUnsupported + } + return 0, r.err + } + buf := r.buf[:checksumSize] + if !r.readFull(buf, false) { + return 0, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read directly into r.decoded instead of via r.buf. + n := chunkLen - checksumSize + if r.snappyFrame && n > maxSnappyBlockSize { + r.err = ErrCorrupt + return 0, r.err + } + if n > len(r.decoded) { + if n > r.maxBlock { + r.err = ErrCorrupt + return 0, r.err + } + r.decoded = make([]byte, n) + } + if !r.readFull(r.decoded[:n], false) { + return 0, r.err + } + if !r.ignoreCRC && crc(r.decoded[:n]) != checksum { + r.err = ErrCRC + return 0, r.err + } + r.i, r.j = 0, n + continue + + case chunkTypeStreamIdentifier: + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(magicBody) { + r.err = ErrCorrupt + return 0, r.err + } + if !r.readFull(r.buf[:len(magicBody)], false) { + return 0, r.err + } + if string(r.buf[:len(magicBody)]) != magicBody { + if string(r.buf[:len(magicBody)]) != magicBodySnappy { + r.err = ErrCorrupt + return 0, r.err + } else { + r.snappyFrame = true + } + } else { + r.snappyFrame = false + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + // fmt.Printf("ERR chunktype: 0x%x\n", chunkType) + r.err = ErrUnsupported + return 0, r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if chunkLen > maxChunkSize { + // fmt.Printf("ERR chunkLen: 0x%x\n", chunkLen) + r.err = ErrUnsupported + return 0, r.err + } + + // fmt.Printf("skippable: ID: 0x%x, len: 0x%x\n", chunkType, chunkLen) + if !r.skippable(r.buf, chunkLen, false, chunkType) { + return 0, r.err + } + } +} + +// DecodeConcurrent will decode the full stream to w. +// This function should not be combined with reading, seeking or other operations. +// Up to 'concurrent' goroutines will be used. +// If <= 0, runtime.NumCPU will be used. +// On success the number of bytes decompressed nil and is returned. +// This is mainly intended for bigger streams. +func (r *Reader) DecodeConcurrent(w io.Writer, concurrent int) (written int64, err error) { + if r.i > 0 || r.j > 0 || r.blockStart > 0 { + return 0, errors.New("DecodeConcurrent called after ") + } + if concurrent <= 0 { + concurrent = runtime.NumCPU() + } + + // Write to output + var errMu sync.Mutex + var aErr error + setErr := func(e error) (ok bool) { + errMu.Lock() + defer errMu.Unlock() + if e == nil { + return aErr == nil + } + if aErr == nil { + aErr = e + } + return false + } + hasErr := func() (ok bool) { + errMu.Lock() + v := aErr != nil + errMu.Unlock() + return v + } + + var aWritten int64 + toRead := make(chan []byte, concurrent) + writtenBlocks := make(chan []byte, concurrent) + queue := make(chan chan []byte, concurrent) + reUse := make(chan chan []byte, concurrent) + for i := 0; i < concurrent; i++ { + toRead <- make([]byte, 0, r.maxBufSize) + writtenBlocks <- make([]byte, 0, r.maxBufSize) + reUse <- make(chan []byte, 1) + } + // Writer + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + for toWrite := range queue { + entry := <-toWrite + reUse <- toWrite + if hasErr() { + writtenBlocks <- entry + continue + } + n, err := w.Write(entry) + want := len(entry) + writtenBlocks <- entry + if err != nil { + setErr(err) + continue + } + if n != want { + setErr(io.ErrShortWrite) + continue + } + aWritten += int64(n) + } + }() + + // Reader + defer func() { + close(queue) + if r.err != nil { + err = r.err + setErr(r.err) + } + wg.Wait() + if err == nil { + err = aErr + } + written = aWritten + }() + + for !hasErr() { + if !r.readFull(r.buf[:4], true) { + if r.err == io.EOF { + r.err = nil + } + return 0, r.err + } + chunkType := r.buf[0] + if !r.readHeader { + if chunkType != chunkTypeStreamIdentifier { + r.err = ErrCorrupt + return 0, r.err + } + r.readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + r.blockStart += int64(r.j) + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + if chunkLen > r.maxBufSize { + r.err = ErrCorrupt + return 0, r.err + } + orgBuf := <-toRead + buf := orgBuf[:chunkLen] + + if !r.readFull(buf, false) { + return 0, r.err + } + + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[checksumSize:] + + n, err := DecodedLen(buf) + if err != nil { + r.err = err + return 0, r.err + } + if r.snappyFrame && n > maxSnappyBlockSize { + r.err = ErrCorrupt + return 0, r.err + } + + if n > r.maxBlock { + r.err = ErrCorrupt + return 0, r.err + } + wg.Add(1) + + decoded := <-writtenBlocks + entry := <-reUse + queue <- entry + go func() { + defer wg.Done() + decoded = decoded[:n] + _, err := Decode(decoded, buf) + toRead <- orgBuf + if err != nil { + writtenBlocks <- decoded + setErr(err) + return + } + if !r.ignoreCRC && crc(decoded) != checksum { + writtenBlocks <- decoded + setErr(ErrCRC) + return + } + entry <- decoded + }() + continue + + case chunkTypeUncompressedData: + + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + if chunkLen > r.maxBufSize { + r.err = ErrCorrupt + return 0, r.err + } + // Grab write buffer + orgBuf := <-writtenBlocks + buf := orgBuf[:checksumSize] + if !r.readFull(buf, false) { + return 0, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read content. + n := chunkLen - checksumSize + + if r.snappyFrame && n > maxSnappyBlockSize { + r.err = ErrCorrupt + return 0, r.err + } + if n > r.maxBlock { + r.err = ErrCorrupt + return 0, r.err + } + // Read uncompressed + buf = orgBuf[:n] + if !r.readFull(buf, false) { + return 0, r.err + } + + if !r.ignoreCRC && crc(buf) != checksum { + r.err = ErrCRC + return 0, r.err + } + entry := <-reUse + queue <- entry + entry <- buf + continue + + case chunkTypeStreamIdentifier: + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(magicBody) { + r.err = ErrCorrupt + return 0, r.err + } + if !r.readFull(r.buf[:len(magicBody)], false) { + return 0, r.err + } + if string(r.buf[:len(magicBody)]) != magicBody { + if string(r.buf[:len(magicBody)]) != magicBodySnappy { + r.err = ErrCorrupt + return 0, r.err + } else { + r.snappyFrame = true + } + } else { + r.snappyFrame = false + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + // fmt.Printf("ERR chunktype: 0x%x\n", chunkType) + r.err = ErrUnsupported + return 0, r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if chunkLen > maxChunkSize { + // fmt.Printf("ERR chunkLen: 0x%x\n", chunkLen) + r.err = ErrUnsupported + return 0, r.err + } + + // fmt.Printf("skippable: ID: 0x%x, len: 0x%x\n", chunkType, chunkLen) + if !r.skippable(r.buf, chunkLen, false, chunkType) { + return 0, r.err + } + } + return 0, r.err +} + +// Skip will skip n bytes forward in the decompressed output. +// For larger skips this consumes less CPU and is faster than reading output and discarding it. +// CRC is not checked on skipped blocks. +// io.ErrUnexpectedEOF is returned if the stream ends before all bytes have been skipped. +// If a decoding error is encountered subsequent calls to Read will also fail. +func (r *Reader) Skip(n int64) error { + if n < 0 { + return errors.New("attempted negative skip") + } + if r.err != nil { + return r.err + } + + for n > 0 { + if r.i < r.j { + // Skip in buffer. + // decoded[i:j] contains decoded bytes that have not yet been passed on. + left := int64(r.j - r.i) + if left >= n { + tmp := int64(r.i) + n + if tmp > math.MaxInt32 { + return errors.New("s2: internal overflow in skip") + } + r.i = int(tmp) + return nil + } + n -= int64(r.j - r.i) + r.i = r.j + } + + // Buffer empty; read blocks until we have content. + if !r.readFull(r.buf[:4], true) { + if r.err == io.EOF { + r.err = io.ErrUnexpectedEOF + } + return r.err + } + chunkType := r.buf[0] + if !r.readHeader { + if chunkType != chunkTypeStreamIdentifier { + r.err = ErrCorrupt + return r.err + } + r.readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + r.blockStart += int64(r.j) + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return r.err + } + if !r.ensureBufferSize(chunkLen) { + if r.err == nil { + r.err = ErrUnsupported + } + return r.err + } + buf := r.buf[:chunkLen] + if !r.readFull(buf, false) { + return r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[checksumSize:] + + dLen, err := DecodedLen(buf) + if err != nil { + r.err = err + return r.err + } + if dLen > r.maxBlock { + r.err = ErrCorrupt + return r.err + } + // Check if destination is within this block + if int64(dLen) > n { + if len(r.decoded) < dLen { + r.decoded = make([]byte, dLen) + } + if _, err := Decode(r.decoded, buf); err != nil { + r.err = err + return r.err + } + if crc(r.decoded[:dLen]) != checksum { + r.err = ErrCorrupt + return r.err + } + } else { + // Skip block completely + n -= int64(dLen) + r.blockStart += int64(dLen) + dLen = 0 + } + r.i, r.j = 0, dLen + continue + case chunkTypeUncompressedData: + r.blockStart += int64(r.j) + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return r.err + } + if !r.ensureBufferSize(chunkLen) { + if r.err != nil { + r.err = ErrUnsupported + } + return r.err + } + buf := r.buf[:checksumSize] + if !r.readFull(buf, false) { + return r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read directly into r.decoded instead of via r.buf. + n2 := chunkLen - checksumSize + if n2 > len(r.decoded) { + if n2 > r.maxBlock { + r.err = ErrCorrupt + return r.err + } + r.decoded = make([]byte, n2) + } + if !r.readFull(r.decoded[:n2], false) { + return r.err + } + if int64(n2) < n { + if crc(r.decoded[:n2]) != checksum { + r.err = ErrCorrupt + return r.err + } + } + r.i, r.j = 0, n2 + continue + case chunkTypeStreamIdentifier: + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(magicBody) { + r.err = ErrCorrupt + return r.err + } + if !r.readFull(r.buf[:len(magicBody)], false) { + return r.err + } + if string(r.buf[:len(magicBody)]) != magicBody { + if string(r.buf[:len(magicBody)]) != magicBodySnappy { + r.err = ErrCorrupt + return r.err + } + } + + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + r.err = ErrUnsupported + return r.err + } + if chunkLen > maxChunkSize { + r.err = ErrUnsupported + return r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if !r.skippable(r.buf, chunkLen, false, chunkType) { + return r.err + } + } + return nil +} + +// ReadSeeker provides random or forward seeking in compressed content. +// See Reader.ReadSeeker +type ReadSeeker struct { + *Reader + readAtMu sync.Mutex +} + +// ReadSeeker will return an io.ReadSeeker and io.ReaderAt +// compatible version of the reader. +// If 'random' is specified the returned io.Seeker can be used for +// random seeking, otherwise only forward seeking is supported. +// Enabling random seeking requires the original input to support +// the io.Seeker interface. +// A custom index can be specified which will be used if supplied. +// When using a custom index, it will not be read from the input stream. +// The ReadAt position will affect regular reads and the current position of Seek. +// So using Read after ReadAt will continue from where the ReadAt stopped. +// No functions should be used concurrently. +// The returned ReadSeeker contains a shallow reference to the existing Reader, +// meaning changes performed to one is reflected in the other. +func (r *Reader) ReadSeeker(random bool, index []byte) (*ReadSeeker, error) { + // Read index if provided. + if len(index) != 0 { + if r.index == nil { + r.index = &Index{} + } + if _, err := r.index.Load(index); err != nil { + return nil, ErrCantSeek{Reason: "loading index returned: " + err.Error()} + } + } + + // Check if input is seekable + rs, ok := r.r.(io.ReadSeeker) + if !ok { + if !random { + return &ReadSeeker{Reader: r}, nil + } + return nil, ErrCantSeek{Reason: "input stream isn't seekable"} + } + + if r.index != nil { + // Seekable and index, ok... + return &ReadSeeker{Reader: r}, nil + } + + // Load from stream. + r.index = &Index{} + + // Read current position. + pos, err := rs.Seek(0, io.SeekCurrent) + if err != nil { + return nil, ErrCantSeek{Reason: "seeking input returned: " + err.Error()} + } + err = r.index.LoadStream(rs) + if err != nil { + if err == ErrUnsupported { + // If we don't require random seeking, reset input and return. + if !random { + _, err = rs.Seek(pos, io.SeekStart) + if err != nil { + return nil, ErrCantSeek{Reason: "resetting stream returned: " + err.Error()} + } + r.index = nil + return &ReadSeeker{Reader: r}, nil + } + return nil, ErrCantSeek{Reason: "input stream does not contain an index"} + } + return nil, ErrCantSeek{Reason: "reading index returned: " + err.Error()} + } + + // reset position. + _, err = rs.Seek(pos, io.SeekStart) + if err != nil { + return nil, ErrCantSeek{Reason: "seeking input returned: " + err.Error()} + } + return &ReadSeeker{Reader: r}, nil +} + +// Seek allows seeking in compressed data. +func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error) { + if r.err != nil { + if !errors.Is(r.err, io.EOF) { + return 0, r.err + } + // Reset on EOF + r.err = nil + } + + // Calculate absolute offset. + absOffset := offset + + switch whence { + case io.SeekStart: + case io.SeekCurrent: + absOffset = r.blockStart + int64(r.i) + offset + case io.SeekEnd: + if r.index == nil { + return 0, ErrUnsupported + } + absOffset = r.index.TotalUncompressed + offset + default: + r.err = ErrUnsupported + return 0, r.err + } + + if absOffset < 0 { + return 0, errors.New("seek before start of file") + } + + if !r.readHeader { + // Make sure we read the header. + _, r.err = r.Read([]byte{}) + if r.err != nil { + return 0, r.err + } + } + + // If we are inside current block no need to seek. + // This includes no offset changes. + if absOffset >= r.blockStart && absOffset < r.blockStart+int64(r.j) { + r.i = int(absOffset - r.blockStart) + return r.blockStart + int64(r.i), nil + } + + rs, ok := r.r.(io.ReadSeeker) + if r.index == nil || !ok { + currOffset := r.blockStart + int64(r.i) + if absOffset >= currOffset { + err := r.Skip(absOffset - currOffset) + return r.blockStart + int64(r.i), err + } + return 0, ErrUnsupported + } + + // We can seek and we have an index. + c, u, err := r.index.Find(absOffset) + if err != nil { + return r.blockStart + int64(r.i), err + } + + // Seek to next block + _, err = rs.Seek(c, io.SeekStart) + if err != nil { + return 0, err + } + + r.i = r.j // Remove rest of current block. + r.blockStart = u - int64(r.j) // Adjust current block start for accounting. + if u < absOffset { + // Forward inside block + return absOffset, r.Skip(absOffset - u) + } + if u > absOffset { + return 0, fmt.Errorf("s2 seek: (internal error) u (%d) > absOffset (%d)", u, absOffset) + } + return absOffset, nil +} + +// ReadAt reads len(p) bytes into p starting at offset off in the +// underlying input source. It returns the number of bytes +// read (0 <= n <= len(p)) and any error encountered. +// +// When ReadAt returns n < len(p), it returns a non-nil error +// explaining why more bytes were not returned. In this respect, +// ReadAt is stricter than Read. +// +// Even if ReadAt returns n < len(p), it may use all of p as scratch +// space during the call. If some data is available but not len(p) bytes, +// ReadAt blocks until either all the data is available or an error occurs. +// In this respect ReadAt is different from Read. +// +// If the n = len(p) bytes returned by ReadAt are at the end of the +// input source, ReadAt may return either err == EOF or err == nil. +// +// If ReadAt is reading from an input source with a seek offset, +// ReadAt should not affect nor be affected by the underlying +// seek offset. +// +// Clients of ReadAt can execute parallel ReadAt calls on the +// same input source. This is however not recommended. +func (r *ReadSeeker) ReadAt(p []byte, offset int64) (int, error) { + r.readAtMu.Lock() + defer r.readAtMu.Unlock() + _, err := r.Seek(offset, io.SeekStart) + if err != nil { + return 0, err + } + n := 0 + for n < len(p) { + n2, err := r.Read(p[n:]) + if err != nil { + // This will include io.EOF + return n + n2, err + } + n += n2 + } + return n, nil +} + +// ReadByte satisfies the io.ByteReader interface. +func (r *Reader) ReadByte() (byte, error) { + if r.err != nil { + return 0, r.err + } + if r.i < r.j { + c := r.decoded[r.i] + r.i++ + return c, nil + } + var tmp [1]byte + for i := 0; i < 10; i++ { + n, err := r.Read(tmp[:]) + if err != nil { + return 0, err + } + if n == 1 { + return tmp[0], nil + } + } + return 0, io.ErrNoProgress +} + +// SkippableCB will register a callback for chunks with the specified ID. +// ID must be a Reserved skippable chunks ID, 0x80-0xfe (inclusive). +// For each chunk with the ID, the callback is called with the content. +// Any returned non-nil error will abort decompression. +// Only one callback per ID is supported, latest sent will be used. +// Sending a nil function will disable previous callbacks. +func (r *Reader) SkippableCB(id uint8, fn func(r io.Reader) error) error { + if id < 0x80 || id > chunkTypePadding { + return fmt.Errorf("ReaderSkippableCB: Invalid id provided, must be 0x80-0xfe (inclusive)") + } + r.skippableCB[id] = fn + return nil +} diff --git a/vendor/github.com/klauspost/compress/s2/writer.go b/vendor/github.com/klauspost/compress/s2/writer.go new file mode 100644 index 000000000..5a944068c --- /dev/null +++ b/vendor/github.com/klauspost/compress/s2/writer.go @@ -0,0 +1,1020 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Copyright (c) 2019+ Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package s2 + +import ( + "crypto/rand" + "encoding/binary" + "errors" + "fmt" + "io" + "runtime" + "sync" +) + +const ( + levelUncompressed = iota + 1 + levelFast + levelBetter + levelBest +) + +// NewWriter returns a new Writer that compresses to w, using the +// framing format described at +// https://github.com/google/snappy/blob/master/framing_format.txt +// +// Users must call Close to guarantee all data has been forwarded to +// the underlying io.Writer and that resources are released. +// They may also call Flush zero or more times before calling Close. +func NewWriter(w io.Writer, opts ...WriterOption) *Writer { + w2 := Writer{ + blockSize: defaultBlockSize, + concurrency: runtime.GOMAXPROCS(0), + randSrc: rand.Reader, + level: levelFast, + } + for _, opt := range opts { + if err := opt(&w2); err != nil { + w2.errState = err + return &w2 + } + } + w2.obufLen = obufHeaderLen + MaxEncodedLen(w2.blockSize) + w2.paramsOK = true + w2.ibuf = make([]byte, 0, w2.blockSize) + w2.buffers.New = func() interface{} { + return make([]byte, w2.obufLen) + } + w2.Reset(w) + return &w2 +} + +// Writer is an io.Writer that can write Snappy-compressed bytes. +type Writer struct { + errMu sync.Mutex + errState error + + // ibuf is a buffer for the incoming (uncompressed) bytes. + ibuf []byte + + blockSize int + obufLen int + concurrency int + written int64 + uncompWritten int64 // Bytes sent to compression + output chan chan result + buffers sync.Pool + pad int + + writer io.Writer + randSrc io.Reader + writerWg sync.WaitGroup + index Index + customEnc func(dst, src []byte) int + + // wroteStreamHeader is whether we have written the stream header. + wroteStreamHeader bool + paramsOK bool + snappy bool + flushOnWrite bool + appendIndex bool + level uint8 +} + +type result struct { + b []byte + // Uncompressed start offset + startOffset int64 +} + +// err returns the previously set error. +// If no error has been set it is set to err if not nil. +func (w *Writer) err(err error) error { + w.errMu.Lock() + errSet := w.errState + if errSet == nil && err != nil { + w.errState = err + errSet = err + } + w.errMu.Unlock() + return errSet +} + +// Reset discards the writer's state and switches the Snappy writer to write to w. +// This permits reusing a Writer rather than allocating a new one. +func (w *Writer) Reset(writer io.Writer) { + if !w.paramsOK { + return + } + // Close previous writer, if any. + if w.output != nil { + close(w.output) + w.writerWg.Wait() + w.output = nil + } + w.errState = nil + w.ibuf = w.ibuf[:0] + w.wroteStreamHeader = false + w.written = 0 + w.writer = writer + w.uncompWritten = 0 + w.index.reset(w.blockSize) + + // If we didn't get a writer, stop here. + if writer == nil { + return + } + // If no concurrency requested, don't spin up writer goroutine. + if w.concurrency == 1 { + return + } + + toWrite := make(chan chan result, w.concurrency) + w.output = toWrite + w.writerWg.Add(1) + + // Start a writer goroutine that will write all output in order. + go func() { + defer w.writerWg.Done() + + // Get a queued write. + for write := range toWrite { + // Wait for the data to be available. + input := <-write + in := input.b + if len(in) > 0 { + if w.err(nil) == nil { + // Don't expose data from previous buffers. + toWrite := in[:len(in):len(in)] + // Write to output. + n, err := writer.Write(toWrite) + if err == nil && n != len(toWrite) { + err = io.ErrShortBuffer + } + _ = w.err(err) + w.err(w.index.add(w.written, input.startOffset)) + w.written += int64(n) + } + } + if cap(in) >= w.obufLen { + w.buffers.Put(in) + } + // close the incoming write request. + // This can be used for synchronizing flushes. + close(write) + } + }() +} + +// Write satisfies the io.Writer interface. +func (w *Writer) Write(p []byte) (nRet int, errRet error) { + if err := w.err(nil); err != nil { + return 0, err + } + if w.flushOnWrite { + return w.write(p) + } + // If we exceed the input buffer size, start writing + for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err(nil) == nil { + var n int + if len(w.ibuf) == 0 { + // Large write, empty buffer. + // Write directly from p to avoid copy. + n, _ = w.write(p) + } else { + n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) + w.ibuf = w.ibuf[:len(w.ibuf)+n] + w.write(w.ibuf) + w.ibuf = w.ibuf[:0] + } + nRet += n + p = p[n:] + } + if err := w.err(nil); err != nil { + return nRet, err + } + // p should always be able to fit into w.ibuf now. + n := copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) + w.ibuf = w.ibuf[:len(w.ibuf)+n] + nRet += n + return nRet, nil +} + +// ReadFrom implements the io.ReaderFrom interface. +// Using this is typically more efficient since it avoids a memory copy. +// ReadFrom reads data from r until EOF or error. +// The return value n is the number of bytes read. +// Any error except io.EOF encountered during the read is also returned. +func (w *Writer) ReadFrom(r io.Reader) (n int64, err error) { + if err := w.err(nil); err != nil { + return 0, err + } + if len(w.ibuf) > 0 { + err := w.Flush() + if err != nil { + return 0, err + } + } + if br, ok := r.(byter); ok { + buf := br.Bytes() + if err := w.EncodeBuffer(buf); err != nil { + return 0, err + } + return int64(len(buf)), w.Flush() + } + for { + inbuf := w.buffers.Get().([]byte)[:w.blockSize+obufHeaderLen] + n2, err := io.ReadFull(r, inbuf[obufHeaderLen:]) + if err != nil { + if err == io.ErrUnexpectedEOF { + err = io.EOF + } + if err != io.EOF { + return n, w.err(err) + } + } + if n2 == 0 { + break + } + n += int64(n2) + err2 := w.writeFull(inbuf[:n2+obufHeaderLen]) + if w.err(err2) != nil { + break + } + + if err != nil { + // We got EOF and wrote everything + break + } + } + + return n, w.err(nil) +} + +// AddSkippableBlock will add a skippable block to the stream. +// The ID must be 0x80-0xfe (inclusive). +// Length of the skippable block must be <= 16777215 bytes. +func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) { + if err := w.err(nil); err != nil { + return err + } + if len(data) == 0 { + return nil + } + if id < 0x80 || id > chunkTypePadding { + return fmt.Errorf("invalid skippable block id %x", id) + } + if len(data) > maxChunkSize { + return fmt.Errorf("skippable block excessed maximum size") + } + var header [4]byte + chunkLen := 4 + len(data) + header[0] = id + header[1] = uint8(chunkLen >> 0) + header[2] = uint8(chunkLen >> 8) + header[3] = uint8(chunkLen >> 16) + if w.concurrency == 1 { + write := func(b []byte) error { + n, err := w.writer.Write(b) + if err = w.err(err); err != nil { + return err + } + if n != len(data) { + return w.err(io.ErrShortWrite) + } + w.written += int64(n) + return w.err(nil) + } + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + if w.snappy { + if err := write([]byte(magicChunkSnappy)); err != nil { + return err + } + } else { + if err := write([]byte(magicChunk)); err != nil { + return err + } + } + } + if err := write(header[:]); err != nil { + return err + } + if err := write(data); err != nil { + return err + } + } + + // Create output... + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + hWriter := make(chan result) + w.output <- hWriter + if w.snappy { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} + } else { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} + } + } + + // Copy input. + inbuf := w.buffers.Get().([]byte)[:4] + copy(inbuf, header[:]) + inbuf = append(inbuf, data...) + + output := make(chan result, 1) + // Queue output. + w.output <- output + output <- result{startOffset: w.uncompWritten, b: inbuf} + + return nil +} + +// EncodeBuffer will add a buffer to the stream. +// This is the fastest way to encode a stream, +// but the input buffer cannot be written to by the caller +// until Flush or Close has been called when concurrency != 1. +// +// If you cannot control that, use the regular Write function. +// +// Note that input is not buffered. +// This means that each write will result in discrete blocks being created. +// For buffered writes, use the regular Write function. +func (w *Writer) EncodeBuffer(buf []byte) (err error) { + if err := w.err(nil); err != nil { + return err + } + + if w.flushOnWrite { + _, err := w.write(buf) + return err + } + // Flush queued data first. + if len(w.ibuf) > 0 { + err := w.Flush() + if err != nil { + return err + } + } + if w.concurrency == 1 { + _, err := w.writeSync(buf) + return err + } + + // Spawn goroutine and write block to output channel. + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + hWriter := make(chan result) + w.output <- hWriter + if w.snappy { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} + } else { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} + } + } + + for len(buf) > 0 { + // Cut input. + uncompressed := buf + if len(uncompressed) > w.blockSize { + uncompressed = uncompressed[:w.blockSize] + } + buf = buf[len(uncompressed):] + // Get an output buffer. + obuf := w.buffers.Get().([]byte)[:len(uncompressed)+obufHeaderLen] + output := make(chan result) + // Queue output now, so we keep order. + w.output <- output + res := result{ + startOffset: w.uncompWritten, + } + w.uncompWritten += int64(len(uncompressed)) + go func() { + checksum := crc(uncompressed) + + // Set to uncompressed. + chunkType := uint8(chunkTypeUncompressedData) + chunkLen := 4 + len(uncompressed) + + // Attempt compressing. + n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) + n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) + + // Check if we should use this, or store as uncompressed instead. + if n2 > 0 { + chunkType = uint8(chunkTypeCompressedData) + chunkLen = 4 + n + n2 + obuf = obuf[:obufHeaderLen+n+n2] + } else { + // copy uncompressed + copy(obuf[obufHeaderLen:], uncompressed) + } + + // Fill in the per-chunk header that comes before the body. + obuf[0] = chunkType + obuf[1] = uint8(chunkLen >> 0) + obuf[2] = uint8(chunkLen >> 8) + obuf[3] = uint8(chunkLen >> 16) + obuf[4] = uint8(checksum >> 0) + obuf[5] = uint8(checksum >> 8) + obuf[6] = uint8(checksum >> 16) + obuf[7] = uint8(checksum >> 24) + + // Queue final output. + res.b = obuf + output <- res + }() + } + return nil +} + +func (w *Writer) encodeBlock(obuf, uncompressed []byte) int { + if w.customEnc != nil { + if ret := w.customEnc(obuf, uncompressed); ret >= 0 { + return ret + } + } + if w.snappy { + switch w.level { + case levelFast: + return encodeBlockSnappy(obuf, uncompressed) + case levelBetter: + return encodeBlockBetterSnappy(obuf, uncompressed) + case levelBest: + return encodeBlockBestSnappy(obuf, uncompressed) + } + return 0 + } + switch w.level { + case levelFast: + return encodeBlock(obuf, uncompressed) + case levelBetter: + return encodeBlockBetter(obuf, uncompressed) + case levelBest: + return encodeBlockBest(obuf, uncompressed, nil) + } + return 0 +} + +func (w *Writer) write(p []byte) (nRet int, errRet error) { + if err := w.err(nil); err != nil { + return 0, err + } + if w.concurrency == 1 { + return w.writeSync(p) + } + + // Spawn goroutine and write block to output channel. + for len(p) > 0 { + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + hWriter := make(chan result) + w.output <- hWriter + if w.snappy { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} + } else { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} + } + } + + var uncompressed []byte + if len(p) > w.blockSize { + uncompressed, p = p[:w.blockSize], p[w.blockSize:] + } else { + uncompressed, p = p, nil + } + + // Copy input. + // If the block is incompressible, this is used for the result. + inbuf := w.buffers.Get().([]byte)[:len(uncompressed)+obufHeaderLen] + obuf := w.buffers.Get().([]byte)[:w.obufLen] + copy(inbuf[obufHeaderLen:], uncompressed) + uncompressed = inbuf[obufHeaderLen:] + + output := make(chan result) + // Queue output now, so we keep order. + w.output <- output + res := result{ + startOffset: w.uncompWritten, + } + w.uncompWritten += int64(len(uncompressed)) + + go func() { + checksum := crc(uncompressed) + + // Set to uncompressed. + chunkType := uint8(chunkTypeUncompressedData) + chunkLen := 4 + len(uncompressed) + + // Attempt compressing. + n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) + n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) + + // Check if we should use this, or store as uncompressed instead. + if n2 > 0 { + chunkType = uint8(chunkTypeCompressedData) + chunkLen = 4 + n + n2 + obuf = obuf[:obufHeaderLen+n+n2] + } else { + // Use input as output. + obuf, inbuf = inbuf, obuf + } + + // Fill in the per-chunk header that comes before the body. + obuf[0] = chunkType + obuf[1] = uint8(chunkLen >> 0) + obuf[2] = uint8(chunkLen >> 8) + obuf[3] = uint8(chunkLen >> 16) + obuf[4] = uint8(checksum >> 0) + obuf[5] = uint8(checksum >> 8) + obuf[6] = uint8(checksum >> 16) + obuf[7] = uint8(checksum >> 24) + + // Queue final output. + res.b = obuf + output <- res + + // Put unused buffer back in pool. + w.buffers.Put(inbuf) + }() + nRet += len(uncompressed) + } + return nRet, nil +} + +// writeFull is a special version of write that will always write the full buffer. +// Data to be compressed should start at offset obufHeaderLen and fill the remainder of the buffer. +// The data will be written as a single block. +// The caller is not allowed to use inbuf after this function has been called. +func (w *Writer) writeFull(inbuf []byte) (errRet error) { + if err := w.err(nil); err != nil { + return err + } + + if w.concurrency == 1 { + _, err := w.writeSync(inbuf[obufHeaderLen:]) + return err + } + + // Spawn goroutine and write block to output channel. + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + hWriter := make(chan result) + w.output <- hWriter + if w.snappy { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunkSnappy)} + } else { + hWriter <- result{startOffset: w.uncompWritten, b: []byte(magicChunk)} + } + } + + // Get an output buffer. + obuf := w.buffers.Get().([]byte)[:w.obufLen] + uncompressed := inbuf[obufHeaderLen:] + + output := make(chan result) + // Queue output now, so we keep order. + w.output <- output + res := result{ + startOffset: w.uncompWritten, + } + w.uncompWritten += int64(len(uncompressed)) + + go func() { + checksum := crc(uncompressed) + + // Set to uncompressed. + chunkType := uint8(chunkTypeUncompressedData) + chunkLen := 4 + len(uncompressed) + + // Attempt compressing. + n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) + n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) + + // Check if we should use this, or store as uncompressed instead. + if n2 > 0 { + chunkType = uint8(chunkTypeCompressedData) + chunkLen = 4 + n + n2 + obuf = obuf[:obufHeaderLen+n+n2] + } else { + // Use input as output. + obuf, inbuf = inbuf, obuf + } + + // Fill in the per-chunk header that comes before the body. + obuf[0] = chunkType + obuf[1] = uint8(chunkLen >> 0) + obuf[2] = uint8(chunkLen >> 8) + obuf[3] = uint8(chunkLen >> 16) + obuf[4] = uint8(checksum >> 0) + obuf[5] = uint8(checksum >> 8) + obuf[6] = uint8(checksum >> 16) + obuf[7] = uint8(checksum >> 24) + + // Queue final output. + res.b = obuf + output <- res + + // Put unused buffer back in pool. + w.buffers.Put(inbuf) + }() + return nil +} + +func (w *Writer) writeSync(p []byte) (nRet int, errRet error) { + if err := w.err(nil); err != nil { + return 0, err + } + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + var n int + var err error + if w.snappy { + n, err = w.writer.Write([]byte(magicChunkSnappy)) + } else { + n, err = w.writer.Write([]byte(magicChunk)) + } + if err != nil { + return 0, w.err(err) + } + if n != len(magicChunk) { + return 0, w.err(io.ErrShortWrite) + } + w.written += int64(n) + } + + for len(p) > 0 { + var uncompressed []byte + if len(p) > w.blockSize { + uncompressed, p = p[:w.blockSize], p[w.blockSize:] + } else { + uncompressed, p = p, nil + } + + obuf := w.buffers.Get().([]byte)[:w.obufLen] + checksum := crc(uncompressed) + + // Set to uncompressed. + chunkType := uint8(chunkTypeUncompressedData) + chunkLen := 4 + len(uncompressed) + + // Attempt compressing. + n := binary.PutUvarint(obuf[obufHeaderLen:], uint64(len(uncompressed))) + n2 := w.encodeBlock(obuf[obufHeaderLen+n:], uncompressed) + + if n2 > 0 { + chunkType = uint8(chunkTypeCompressedData) + chunkLen = 4 + n + n2 + obuf = obuf[:obufHeaderLen+n+n2] + } else { + obuf = obuf[:8] + } + + // Fill in the per-chunk header that comes before the body. + obuf[0] = chunkType + obuf[1] = uint8(chunkLen >> 0) + obuf[2] = uint8(chunkLen >> 8) + obuf[3] = uint8(chunkLen >> 16) + obuf[4] = uint8(checksum >> 0) + obuf[5] = uint8(checksum >> 8) + obuf[6] = uint8(checksum >> 16) + obuf[7] = uint8(checksum >> 24) + + n, err := w.writer.Write(obuf) + if err != nil { + return 0, w.err(err) + } + if n != len(obuf) { + return 0, w.err(io.ErrShortWrite) + } + w.err(w.index.add(w.written, w.uncompWritten)) + w.written += int64(n) + w.uncompWritten += int64(len(uncompressed)) + + if chunkType == chunkTypeUncompressedData { + // Write uncompressed data. + n, err := w.writer.Write(uncompressed) + if err != nil { + return 0, w.err(err) + } + if n != len(uncompressed) { + return 0, w.err(io.ErrShortWrite) + } + w.written += int64(n) + } + w.buffers.Put(obuf) + // Queue final output. + nRet += len(uncompressed) + } + return nRet, nil +} + +// Flush flushes the Writer to its underlying io.Writer. +// This does not apply padding. +func (w *Writer) Flush() error { + if err := w.err(nil); err != nil { + return err + } + + // Queue any data still in input buffer. + if len(w.ibuf) != 0 { + if !w.wroteStreamHeader { + _, err := w.writeSync(w.ibuf) + w.ibuf = w.ibuf[:0] + return w.err(err) + } else { + _, err := w.write(w.ibuf) + w.ibuf = w.ibuf[:0] + err = w.err(err) + if err != nil { + return err + } + } + } + if w.output == nil { + return w.err(nil) + } + + // Send empty buffer + res := make(chan result) + w.output <- res + // Block until this has been picked up. + res <- result{b: nil, startOffset: w.uncompWritten} + // When it is closed, we have flushed. + <-res + return w.err(nil) +} + +// Close calls Flush and then closes the Writer. +// Calling Close multiple times is ok, +// but calling CloseIndex after this will make it not return the index. +func (w *Writer) Close() error { + _, err := w.closeIndex(w.appendIndex) + return err +} + +// CloseIndex calls Close and returns an index on first call. +// This is not required if you are only adding index to a stream. +func (w *Writer) CloseIndex() ([]byte, error) { + return w.closeIndex(true) +} + +func (w *Writer) closeIndex(idx bool) ([]byte, error) { + err := w.Flush() + if w.output != nil { + close(w.output) + w.writerWg.Wait() + w.output = nil + } + + var index []byte + if w.err(nil) == nil && w.writer != nil { + // Create index. + if idx { + compSize := int64(-1) + if w.pad <= 1 { + compSize = w.written + } + index = w.index.appendTo(w.ibuf[:0], w.uncompWritten, compSize) + // Count as written for padding. + if w.appendIndex { + w.written += int64(len(index)) + } + } + + if w.pad > 1 { + tmp := w.ibuf[:0] + if len(index) > 0 { + // Allocate another buffer. + tmp = w.buffers.Get().([]byte)[:0] + defer w.buffers.Put(tmp) + } + add := calcSkippableFrame(w.written, int64(w.pad)) + frame, err := skippableFrame(tmp, add, w.randSrc) + if err = w.err(err); err != nil { + return nil, err + } + n, err2 := w.writer.Write(frame) + if err2 == nil && n != len(frame) { + err2 = io.ErrShortWrite + } + _ = w.err(err2) + } + if len(index) > 0 && w.appendIndex { + n, err2 := w.writer.Write(index) + if err2 == nil && n != len(index) { + err2 = io.ErrShortWrite + } + _ = w.err(err2) + } + } + err = w.err(errClosed) + if err == errClosed { + return index, nil + } + return nil, err +} + +// calcSkippableFrame will return a total size to be added for written +// to be divisible by multiple. +// The value will always be > skippableFrameHeader. +// The function will panic if written < 0 or wantMultiple <= 0. +func calcSkippableFrame(written, wantMultiple int64) int { + if wantMultiple <= 0 { + panic("wantMultiple <= 0") + } + if written < 0 { + panic("written < 0") + } + leftOver := written % wantMultiple + if leftOver == 0 { + return 0 + } + toAdd := wantMultiple - leftOver + for toAdd < skippableFrameHeader { + toAdd += wantMultiple + } + return int(toAdd) +} + +// skippableFrame will add a skippable frame with a total size of bytes. +// total should be >= skippableFrameHeader and < maxBlockSize + skippableFrameHeader +func skippableFrame(dst []byte, total int, r io.Reader) ([]byte, error) { + if total == 0 { + return dst, nil + } + if total < skippableFrameHeader { + return dst, fmt.Errorf("s2: requested skippable frame (%d) < 4", total) + } + if int64(total) >= maxBlockSize+skippableFrameHeader { + return dst, fmt.Errorf("s2: requested skippable frame (%d) >= max 1<<24", total) + } + // Chunk type 0xfe "Section 4.4 Padding (chunk type 0xfe)" + dst = append(dst, chunkTypePadding) + f := uint32(total - skippableFrameHeader) + // Add chunk length. + dst = append(dst, uint8(f), uint8(f>>8), uint8(f>>16)) + // Add data + start := len(dst) + dst = append(dst, make([]byte, f)...) + _, err := io.ReadFull(r, dst[start:]) + return dst, err +} + +var errClosed = errors.New("s2: Writer is closed") + +// WriterOption is an option for creating a encoder. +type WriterOption func(*Writer) error + +// WriterConcurrency will set the concurrency, +// meaning the maximum number of decoders to run concurrently. +// The value supplied must be at least 1. +// By default this will be set to GOMAXPROCS. +func WriterConcurrency(n int) WriterOption { + return func(w *Writer) error { + if n <= 0 { + return errors.New("concurrency must be at least 1") + } + w.concurrency = n + return nil + } +} + +// WriterAddIndex will append an index to the end of a stream +// when it is closed. +func WriterAddIndex() WriterOption { + return func(w *Writer) error { + w.appendIndex = true + return nil + } +} + +// WriterBetterCompression will enable better compression. +// EncodeBetter compresses better than Encode but typically with a +// 10-40% speed decrease on both compression and decompression. +func WriterBetterCompression() WriterOption { + return func(w *Writer) error { + w.level = levelBetter + return nil + } +} + +// WriterBestCompression will enable better compression. +// EncodeBetter compresses better than Encode but typically with a +// big speed decrease on compression. +func WriterBestCompression() WriterOption { + return func(w *Writer) error { + w.level = levelBest + return nil + } +} + +// WriterUncompressed will bypass compression. +// The stream will be written as uncompressed blocks only. +// If concurrency is > 1 CRC and output will still be done async. +func WriterUncompressed() WriterOption { + return func(w *Writer) error { + w.level = levelUncompressed + return nil + } +} + +// WriterBlockSize allows to override the default block size. +// Blocks will be this size or smaller. +// Minimum size is 4KB and and maximum size is 4MB. +// +// Bigger blocks may give bigger throughput on systems with many cores, +// and will increase compression slightly, but it will limit the possible +// concurrency for smaller payloads for both encoding and decoding. +// Default block size is 1MB. +// +// When writing Snappy compatible output using WriterSnappyCompat, +// the maximum block size is 64KB. +func WriterBlockSize(n int) WriterOption { + return func(w *Writer) error { + if w.snappy && n > maxSnappyBlockSize || n < minBlockSize { + return errors.New("s2: block size too large. Must be <= 64K and >=4KB on for snappy compatible output") + } + if n > maxBlockSize || n < minBlockSize { + return errors.New("s2: block size too large. Must be <= 4MB and >=4KB") + } + w.blockSize = n + return nil + } +} + +// WriterPadding will add padding to all output so the size will be a multiple of n. +// This can be used to obfuscate the exact output size or make blocks of a certain size. +// The contents will be a skippable frame, so it will be invisible by the decoder. +// n must be > 0 and <= 4MB. +// The padded area will be filled with data from crypto/rand.Reader. +// The padding will be applied whenever Close is called on the writer. +func WriterPadding(n int) WriterOption { + return func(w *Writer) error { + if n <= 0 { + return fmt.Errorf("s2: padding must be at least 1") + } + // No need to waste our time. + if n == 1 { + w.pad = 0 + } + if n > maxBlockSize { + return fmt.Errorf("s2: padding must less than 4MB") + } + w.pad = n + return nil + } +} + +// WriterPaddingSrc will get random data for padding from the supplied source. +// By default crypto/rand is used. +func WriterPaddingSrc(reader io.Reader) WriterOption { + return func(w *Writer) error { + w.randSrc = reader + return nil + } +} + +// WriterSnappyCompat will write snappy compatible output. +// The output can be decompressed using either snappy or s2. +// If block size is more than 64KB it is set to that. +func WriterSnappyCompat() WriterOption { + return func(w *Writer) error { + w.snappy = true + if w.blockSize > 64<<10 { + // We choose 8 bytes less than 64K, since that will make literal emits slightly more effective. + // And allows us to skip some size checks. + w.blockSize = (64 << 10) - 8 + } + return nil + } +} + +// WriterFlushOnWrite will compress blocks on each call to the Write function. +// +// This is quite inefficient as blocks size will depend on the write size. +// +// Use WriterConcurrency(1) to also make sure that output is flushed. +// When Write calls return, otherwise they will be written when compression is done. +func WriterFlushOnWrite() WriterOption { + return func(w *Writer) error { + w.flushOnWrite = true + return nil + } +} + +// WriterCustomEncoder allows to override the encoder for blocks on the stream. +// The function must compress 'src' into 'dst' and return the bytes used in dst as an integer. +// Block size (initial varint) should not be added by the encoder. +// Returning value 0 indicates the block could not be compressed. +// Returning a negative value indicates that compression should be attempted. +// The function should expect to be called concurrently. +func WriterCustomEncoder(fn func(dst, src []byte) int) WriterOption { + return func(w *Writer) error { + w.customEnc = fn + return nil + } +} diff --git a/vendor/github.com/minio/minio-go/v7/api-bucket-lifecycle.go b/vendor/github.com/minio/minio-go/v7/api-bucket-lifecycle.go index 3f88d0777..fec5cece5 100644 --- a/vendor/github.com/minio/minio-go/v7/api-bucket-lifecycle.go +++ b/vendor/github.com/minio/minio-go/v7/api-bucket-lifecycle.go @@ -24,6 +24,7 @@ import ( "io" "net/http" "net/url" + "time" "github.com/minio/minio-go/v7/pkg/lifecycle" "github.com/minio/minio-go/v7/pkg/s3utils" @@ -102,29 +103,36 @@ func (c *Client) removeBucketLifecycle(ctx context.Context, bucketName string) e // GetBucketLifecycle fetch bucket lifecycle configuration func (c *Client) GetBucketLifecycle(ctx context.Context, bucketName string) (*lifecycle.Configuration, error) { + lc, _, err := c.GetBucketLifecycleWithInfo(ctx, bucketName) + return lc, err +} + +// GetBucketLifecycleWithInfo fetch bucket lifecycle configuration along with when it was last updated +func (c *Client) GetBucketLifecycleWithInfo(ctx context.Context, bucketName string) (*lifecycle.Configuration, time.Time, error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { - return nil, err + return nil, time.Time{}, err } - bucketLifecycle, err := c.getBucketLifecycle(ctx, bucketName) + bucketLifecycle, updatedAt, err := c.getBucketLifecycle(ctx, bucketName) if err != nil { - return nil, err + return nil, time.Time{}, err } config := lifecycle.NewConfiguration() if err = xml.Unmarshal(bucketLifecycle, config); err != nil { - return nil, err + return nil, time.Time{}, err } - return config, nil + return config, updatedAt, nil } // Request server for current bucket lifecycle. -func (c *Client) getBucketLifecycle(ctx context.Context, bucketName string) ([]byte, error) { +func (c *Client) getBucketLifecycle(ctx context.Context, bucketName string) ([]byte, time.Time, error) { // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("lifecycle", "") + urlValues.Set("withUpdatedAt", "true") // Execute GET on bucket to get lifecycle. resp, err := c.executeMethod(ctx, http.MethodGet, requestMetadata{ @@ -134,14 +142,28 @@ func (c *Client) getBucketLifecycle(ctx context.Context, bucketName string) ([]b defer closeResponse(resp) if err != nil { - return nil, err + return nil, time.Time{}, err } if resp != nil { if resp.StatusCode != http.StatusOK { - return nil, httpRespToErrorResponse(resp, bucketName, "") + return nil, time.Time{}, httpRespToErrorResponse(resp, bucketName, "") } } - return io.ReadAll(resp.Body) + lcBytes, err := io.ReadAll(resp.Body) + if err != nil { + return nil, time.Time{}, err + } + + const minIOLifecycleCfgUpdatedAt = "X-Minio-LifecycleConfig-UpdatedAt" + var updatedAt time.Time + if timeStr := resp.Header.Get(minIOLifecycleCfgUpdatedAt); timeStr != "" { + updatedAt, err = time.Parse(iso8601DateFormat, timeStr) + if err != nil { + return nil, time.Time{}, err + } + } + + return lcBytes, updatedAt, nil } diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go b/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go index f355d422a..9016ec4b4 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go @@ -27,11 +27,12 @@ import ( "strconv" "strings" "time" + + "github.com/minio/minio-go/v7/pkg/encrypt" ) -// PutObjectFanOutRequest this is the request structure sent -// to the server to fan-out the stream to multiple objects. -type PutObjectFanOutRequest struct { +// PutObjectFanOutEntry is per object entry fan-out metadata +type PutObjectFanOutEntry struct { Key string `json:"key"` UserMetadata map[string]string `json:"metadata,omitempty"` UserTags map[string]string `json:"tags,omitempty"` @@ -44,9 +45,17 @@ type PutObjectFanOutRequest struct { RetainUntilDate *time.Time `json:"retainUntil,omitempty"` } +// PutObjectFanOutRequest this is the request structure sent +// to the server to fan-out the stream to multiple objects. +type PutObjectFanOutRequest struct { + Entries []PutObjectFanOutEntry + Checksum Checksum + SSE encrypt.ServerSide +} + // PutObjectFanOutResponse this is the response structure sent // by the server upon success or failure for each object -// fan-out keys. Additionally this response carries ETag, +// fan-out keys. Additionally, this response carries ETag, // VersionID and LastModified for each object fan-out. type PutObjectFanOutResponse struct { Key string `json:"key"` @@ -60,8 +69,8 @@ type PutObjectFanOutResponse struct { // stream multiple objects are written, defined via a list of PutObjectFanOutRequests. Each entry // in PutObjectFanOutRequest carries an object keyname and its relevant metadata if any. `Key` is // mandatory, rest of the other options in PutObjectFanOutRequest are optional. -func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, body io.Reader, fanOutReq ...PutObjectFanOutRequest) ([]PutObjectFanOutResponse, error) { - if len(fanOutReq) == 0 { +func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, fanOutData io.Reader, fanOutReq PutObjectFanOutRequest) ([]PutObjectFanOutResponse, error) { + if len(fanOutReq.Entries) == 0 { return nil, errInvalidArgument("fan out requests cannot be empty") } @@ -72,6 +81,12 @@ func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, body io.Rea // Expires in 15 minutes. policy.SetExpires(time.Now().UTC().Add(15 * time.Minute)) + // Set encryption headers if any. + policy.SetEncryption(fanOutReq.SSE) + + // Set checksum headers if any. + policy.SetChecksum(fanOutReq.Checksum) + url, formData, err := c.PresignedPostPolicy(ctx, policy) if err != nil { return nil, err @@ -87,7 +102,7 @@ func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, body io.Rea var b strings.Builder enc := json.NewEncoder(&b) - for _, req := range fanOutReq { + for _, req := range fanOutReq.Entries { if req.Key == "" { w.Close() return nil, errors.New("PutObjectFanOutRequest.Key is mandatory and cannot be empty") @@ -120,7 +135,7 @@ func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, body io.Rea return } - if _, err = io.Copy(mw, body); err != nil { + if _, err = io.Copy(mw, fanOutData); err != nil { return } }() @@ -136,7 +151,7 @@ func (c *Client) PutObjectFanOut(ctx context.Context, bucket string, body io.Rea } dec := json.NewDecoder(resp.Body) - fanOutResp := make([]PutObjectFanOutResponse, 0, len(fanOutReq)) + fanOutResp := make([]PutObjectFanOutResponse, 0, len(fanOutReq.Entries)) for dec.More() { var m PutObjectFanOutResponse if err = dec.Decode(&m); err != nil { diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go b/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go index 55b3f38e6..9182d4eac 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go @@ -193,7 +193,7 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN } sectionReader := newHook(io.NewSectionReader(reader, readOffset, partSize), opts.Progress) - var trailer = make(http.Header, 1) + trailer := make(http.Header, 1) if withChecksum { crc := crc32.New(crc32.MakeTable(crc32.Castagnoli)) trailer.Set("x-amz-checksum-crc32c", base64.StdEncoding.EncodeToString(crc.Sum(nil))) @@ -203,7 +203,8 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN } // Proceed to upload the part. - p := uploadPartParams{bucketName: bucketName, + p := uploadPartParams{ + bucketName: bucketName, objectName: objectName, uploadID: uploadID, reader: sectionReader, @@ -244,7 +245,6 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN return UploadInfo{}, ctx.Err() case uploadRes := <-uploadedPartsCh: if uploadRes.Error != nil { - return UploadInfo{}, uploadRes.Error } @@ -452,7 +452,8 @@ func (c *Client) putObjectMultipartStreamOptionalChecksum(ctx context.Context, b // putObjectMultipartStreamParallel uploads opts.NumThreads parts in parallel. // This is expected to take opts.PartSize * opts.NumThreads * (GOGC / 100) bytes of buffer. func (c *Client) putObjectMultipartStreamParallel(ctx context.Context, bucketName, objectName string, - reader io.Reader, opts PutObjectOptions) (info UploadInfo, err error) { + reader io.Reader, opts PutObjectOptions, +) (info UploadInfo, err error) { // Input validation. if err = s3utils.CheckValidBucketName(bucketName); err != nil { return UploadInfo{}, err @@ -741,6 +742,17 @@ func (c *Client) putObjectDo(ctx context.Context, bucketName, objectName string, // Set headers. customHeader := opts.Header() + // Add CRC when client supports it, MD5 is not set, not Google and we don't add SHA256 to chunks. + addCrc := c.trailingHeaderSupport && md5Base64 == "" && !s3utils.IsGoogleEndpoint(*c.endpointURL) && (opts.DisableContentSha256 || c.secure) + + if addCrc { + // If user has added checksums, don't add them ourselves. + for k := range opts.UserMetadata { + if strings.HasPrefix(strings.ToLower(k), "x-amz-checksum-") { + addCrc = false + } + } + } // Populate request metadata. reqMetadata := requestMetadata{ bucketName: bucketName, @@ -751,6 +763,7 @@ func (c *Client) putObjectDo(ctx context.Context, bucketName, objectName string, contentMD5Base64: md5Base64, contentSHA256Hex: sha256Hex, streamSha256: !opts.DisableContentSha256, + addCrc: addCrc, } if opts.Internal.SourceVersionID != "" { if opts.Internal.SourceVersionID != nullVersionID { diff --git a/vendor/github.com/minio/minio-go/v7/api.go b/vendor/github.com/minio/minio-go/v7/api.go index f5334560b..0546b1ac0 100644 --- a/vendor/github.com/minio/minio-go/v7/api.go +++ b/vendor/github.com/minio/minio-go/v7/api.go @@ -124,7 +124,7 @@ type Options struct { // Global constants. const ( libraryName = "minio-go" - libraryVersion = "v7.0.53" + libraryVersion = "v7.0.55" ) // User Agent should always following the below style. diff --git a/vendor/github.com/minio/minio-go/v7/checksum.go b/vendor/github.com/minio/minio-go/v7/checksum.go new file mode 100644 index 000000000..a1f6f434f --- /dev/null +++ b/vendor/github.com/minio/minio-go/v7/checksum.go @@ -0,0 +1,210 @@ +/* + * MinIO Go Library for Amazon S3 Compatible Cloud Storage + * Copyright 2015-2023 MinIO, Inc. + * + * 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 + * + * http://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 minio + +import ( + "crypto/sha1" + "crypto/sha256" + "encoding/base64" + "hash" + "hash/crc32" + "io" + "math/bits" +) + +// ChecksumType contains information about the checksum type. +type ChecksumType uint32 + +const ( + + // ChecksumSHA256 indicates a SHA256 checksum. + ChecksumSHA256 ChecksumType = 1 << iota + // ChecksumSHA1 indicates a SHA-1 checksum. + ChecksumSHA1 + // ChecksumCRC32 indicates a CRC32 checksum with IEEE table. + ChecksumCRC32 + // ChecksumCRC32C indicates a CRC32 checksum with Castagnoli table. + ChecksumCRC32C + + // Keep after all valid checksums + checksumLast + + // checksumMask is a mask for valid checksum types. + checksumMask = checksumLast - 1 + + // ChecksumNone indicates no checksum. + ChecksumNone ChecksumType = 0 + + amzChecksumAlgo = "x-amz-checksum-algorithm" + amzChecksumCRC32 = "x-amz-checksum-crc32" + amzChecksumCRC32C = "x-amz-checksum-crc32c" + amzChecksumSHA1 = "x-amz-checksum-sha1" + amzChecksumSHA256 = "x-amz-checksum-sha256" +) + +// Is returns if c is all of t. +func (c ChecksumType) Is(t ChecksumType) bool { + return c&t == t +} + +// Key returns the header key. +// returns empty string if invalid or none. +func (c ChecksumType) Key() string { + switch c & checksumMask { + case ChecksumCRC32: + return amzChecksumCRC32 + case ChecksumCRC32C: + return amzChecksumCRC32C + case ChecksumSHA1: + return amzChecksumSHA1 + case ChecksumSHA256: + return amzChecksumSHA256 + } + return "" +} + +// RawByteLen returns the size of the un-encoded checksum. +func (c ChecksumType) RawByteLen() int { + switch c & checksumMask { + case ChecksumCRC32, ChecksumCRC32C: + return 4 + case ChecksumSHA1: + return sha1.Size + case ChecksumSHA256: + return sha256.Size + } + return 0 +} + +// Hasher returns a hasher corresponding to the checksum type. +// Returns nil if no checksum. +func (c ChecksumType) Hasher() hash.Hash { + switch c & checksumMask { + case ChecksumCRC32: + return crc32.NewIEEE() + case ChecksumCRC32C: + return crc32.New(crc32.MakeTable(crc32.Castagnoli)) + case ChecksumSHA1: + return sha1.New() + case ChecksumSHA256: + return sha256.New() + } + return nil +} + +// IsSet returns whether the type is valid and known. +func (c ChecksumType) IsSet() bool { + return bits.OnesCount32(uint32(c)) == 1 +} + +// String returns the type as a string. +// CRC32, CRC32C, SHA1, and SHA256 for valid values. +// Empty string for unset and "" if not valid. +func (c ChecksumType) String() string { + switch c & checksumMask { + case ChecksumCRC32: + return "CRC32" + case ChecksumCRC32C: + return "CRC32C" + case ChecksumSHA1: + return "SHA1" + case ChecksumSHA256: + return "SHA256" + case ChecksumNone: + return "" + } + return "" +} + +// ChecksumReader reads all of r and returns a checksum of type c. +// Returns any error that may have occurred while reading. +func (c ChecksumType) ChecksumReader(r io.Reader) (Checksum, error) { + h := c.Hasher() + if h == nil { + return Checksum{}, nil + } + _, err := io.Copy(h, r) + if err != nil { + return Checksum{}, err + } + return NewChecksum(c, h.Sum(nil)), nil +} + +// ChecksumBytes returns a checksum of the content b with type c. +func (c ChecksumType) ChecksumBytes(b []byte) Checksum { + h := c.Hasher() + if h == nil { + return Checksum{} + } + n, err := h.Write(b) + if err != nil || n != len(b) { + // Shouldn't happen with these checksummers. + return Checksum{} + } + return NewChecksum(c, h.Sum(nil)) +} + +// Checksum is a type and encoded value. +type Checksum struct { + Type ChecksumType + r []byte +} + +// NewChecksum sets the checksum to the value of b, +// which is the raw hash output. +// If the length of c does not match t.RawByteLen, +// a checksum with ChecksumNone is returned. +func NewChecksum(t ChecksumType, b []byte) Checksum { + if t.IsSet() && len(b) == t.RawByteLen() { + return Checksum{Type: t, r: b} + } + return Checksum{} +} + +// NewChecksumString sets the checksum to the value of s, +// which is the base 64 encoded raw hash output. +// If the length of c does not match t.RawByteLen, it is not added. +func NewChecksumString(t ChecksumType, s string) Checksum { + b, _ := base64.StdEncoding.DecodeString(s) + if t.IsSet() && len(b) == t.RawByteLen() { + return Checksum{Type: t, r: b} + } + return Checksum{} +} + +// IsSet returns whether the checksum is valid and known. +func (c Checksum) IsSet() bool { + return c.Type.IsSet() && len(c.r) == c.Type.RawByteLen() +} + +// Encoded returns the encoded value. +// Returns the empty string if not set or valid. +func (c Checksum) Encoded() string { + if !c.IsSet() { + return "" + } + return base64.StdEncoding.EncodeToString(c.r) +} + +// Raw returns the raw checksum value if set. +func (c Checksum) Raw() []byte { + if !c.IsSet() { + return nil + } + return c.r +} diff --git a/vendor/github.com/minio/minio-go/v7/functional_tests.go b/vendor/github.com/minio/minio-go/v7/functional_tests.go index d7eb30322..ed1b7340e 100644 --- a/vendor/github.com/minio/minio-go/v7/functional_tests.go +++ b/vendor/github.com/minio/minio-go/v7/functional_tests.go @@ -2312,7 +2312,7 @@ func testPutMultipartObjectWithChecksums() { cmpChecksum := func(got, want string) { if want != got { - //logError(testName, function, args, startTime, "", "checksum mismatch", fmt.Errorf("want %s, got %s", want, got)) + // logError(testName, function, args, startTime, "", "checksum mismatch", fmt.Errorf("want %s, got %s", want, got)) fmt.Printf("want %s, got %s\n", want, got) return } @@ -2387,6 +2387,369 @@ func testPutMultipartObjectWithChecksums() { successLogger(testName, function, args, startTime).Info() } +// Test PutObject with trailing checksums. +func testTrailingChecksums() { + // initialize logging params + startTime := time.Now() + testName := getFuncName() + function := "PutObject(bucketName, objectName, reader,size, opts)" + args := map[string]interface{}{ + "bucketName": "", + "objectName": "", + "opts": "minio.PutObjectOptions{UserMetadata: metadata, Progress: progress}", + } + + if !isFullMode() { + ignoredLog(testName, function, args, startTime, "Skipping functional tests for short/quick runs").Info() + return + } + + // Instantiate new minio client object. + c, err := minio.New(os.Getenv(serverEndpoint), + &minio.Options{ + Creds: credentials.NewStaticV4(os.Getenv(accessKey), os.Getenv(secretKey), ""), + Secure: mustParseBool(os.Getenv(enableHTTPS)), + TrailingHeaders: true, + }) + if err != nil { + logError(testName, function, args, startTime, "", "MinIO client object creation failed", err) + return + } + + // Enable tracing, write to stderr. + // c.TraceOn(os.Stderr) + + // Set user agent. + c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0") + + // Generate a new random bucket name. + bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-") + args["bucketName"] = bucketName + + // Make a new bucket. + err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"}) + if err != nil { + logError(testName, function, args, startTime, "", "Make bucket failed", err) + return + } + + hashMultiPart := func(b []byte, partSize int, hasher hash.Hash) string { + r := bytes.NewReader(b) + tmp := make([]byte, partSize) + parts := 0 + var all []byte + for { + n, err := io.ReadFull(r, tmp) + if err != nil && err != io.ErrUnexpectedEOF { + logError(testName, function, args, startTime, "", "Calc crc failed", err) + } + if n == 0 { + break + } + parts++ + hasher.Reset() + hasher.Write(tmp[:n]) + all = append(all, hasher.Sum(nil)...) + if err != nil { + break + } + } + hasher.Reset() + hasher.Write(all) + return fmt.Sprintf("%s-%d", base64.StdEncoding.EncodeToString(hasher.Sum(nil)), parts) + } + defer cleanupBucket(bucketName, c) + tests := []struct { + header string + hasher hash.Hash + + // Checksum values + ChecksumCRC32 string + ChecksumCRC32C string + ChecksumSHA1 string + ChecksumSHA256 string + PO minio.PutObjectOptions + }{ + // Currently there is no way to override the checksum type. + {header: "x-amz-checksum-crc32c", + hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)), + ChecksumCRC32C: "set", + PO: minio.PutObjectOptions{ + DisableContentSha256: true, + DisableMultipart: false, + UserMetadata: nil, + PartSize: 5 << 20, + }, + }, + {header: "x-amz-checksum-crc32c", + hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)), + ChecksumCRC32C: "set", + PO: minio.PutObjectOptions{ + DisableContentSha256: true, + DisableMultipart: false, + UserMetadata: nil, + PartSize: 6_645_654, // Rather arbitrary size + }, + }, + {header: "x-amz-checksum-crc32c", + hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)), + ChecksumCRC32C: "set", + PO: minio.PutObjectOptions{ + DisableContentSha256: false, + DisableMultipart: false, + UserMetadata: nil, + PartSize: 5 << 20, + }, + }, + {header: "x-amz-checksum-crc32c", + hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)), + ChecksumCRC32C: "set", + PO: minio.PutObjectOptions{ + DisableContentSha256: false, + DisableMultipart: false, + UserMetadata: nil, + PartSize: 6_645_654, // Rather arbitrary size + }, + }, + } + + for _, test := range tests { + bufSize := dataFileMap["datafile-11-MB"] + + // Save the data + objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "") + args["objectName"] = objectName + + cmpChecksum := func(got, want string) { + if want != got { + logError(testName, function, args, startTime, "", "checksum mismatch", fmt.Errorf("want %q, got %q", want, got)) + return + } + } + + reader := getDataReader("datafile-11-MB") + b, err := io.ReadAll(reader) + if err != nil { + logError(testName, function, args, startTime, "", "Read failed", err) + return + } + reader.Close() + h := test.hasher + h.Reset() + test.ChecksumCRC32C = hashMultiPart(b, int(test.PO.PartSize), test.hasher) + + // Set correct CRC. + c.TraceOn(os.Stdout) + resp, err := c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(b), int64(bufSize), test.PO) + if err != nil { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + c.TraceOff() + cmpChecksum(resp.ChecksumSHA256, test.ChecksumSHA256) + cmpChecksum(resp.ChecksumSHA1, test.ChecksumSHA1) + cmpChecksum(resp.ChecksumCRC32, test.ChecksumCRC32) + cmpChecksum(resp.ChecksumCRC32C, test.ChecksumCRC32C) + + // Read the data back + gopts := minio.GetObjectOptions{Checksum: true} + gopts.PartNumber = 2 + + // We cannot use StatObject, since it ignores partnumber. + r, err := c.GetObject(context.Background(), bucketName, objectName, gopts) + if err != nil { + logError(testName, function, args, startTime, "", "GetObject failed", err) + return + } + io.Copy(io.Discard, r) + st, err := r.Stat() + if err != nil { + logError(testName, function, args, startTime, "", "Stat failed", err) + return + } + + // Test part 2 checksum... + h.Reset() + p2 := b[test.PO.PartSize:] + if len(p2) > int(test.PO.PartSize) { + p2 = p2[:test.PO.PartSize] + } + h.Write(p2) + got := base64.StdEncoding.EncodeToString(h.Sum(nil)) + if test.ChecksumSHA256 != "" { + cmpChecksum(st.ChecksumSHA256, got) + } + if test.ChecksumSHA1 != "" { + cmpChecksum(st.ChecksumSHA1, got) + } + if test.ChecksumCRC32 != "" { + cmpChecksum(st.ChecksumCRC32, got) + } + if test.ChecksumCRC32C != "" { + cmpChecksum(st.ChecksumCRC32C, got) + } + + delete(args, "metadata") + } +} + +// Test PutObject with custom checksums. +func testPutObjectWithAutomaticChecksums() { + // initialize logging params + startTime := time.Now() + testName := getFuncName() + function := "PutObject(bucketName, objectName, reader,size, opts)" + args := map[string]interface{}{ + "bucketName": "", + "objectName": "", + "opts": "minio.PutObjectOptions{UserMetadata: metadata, Progress: progress}", + } + + if !isFullMode() { + ignoredLog(testName, function, args, startTime, "Skipping functional tests for short/quick runs").Info() + return + } + + // Seed random based on current time. + rand.Seed(time.Now().Unix()) + + // Instantiate new minio client object. + c, err := minio.New(os.Getenv(serverEndpoint), + &minio.Options{ + Creds: credentials.NewStaticV4(os.Getenv(accessKey), os.Getenv(secretKey), ""), + Secure: mustParseBool(os.Getenv(enableHTTPS)), + TrailingHeaders: true, + }) + if err != nil { + logError(testName, function, args, startTime, "", "MinIO client object creation failed", err) + return + } + + // Set user agent. + c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0") + + // Generate a new random bucket name. + bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-") + args["bucketName"] = bucketName + + // Make a new bucket. + err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"}) + if err != nil { + logError(testName, function, args, startTime, "", "Make bucket failed", err) + return + } + + defer cleanupBucket(bucketName, c) + tests := []struct { + header string + hasher hash.Hash + + // Checksum values + ChecksumCRC32 string + ChecksumCRC32C string + ChecksumSHA1 string + ChecksumSHA256 string + }{ + // Built-in will only add crc32c, when no MD5 nor SHA256. + {header: "x-amz-checksum-crc32c", hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli))}, + } + + // Enable tracing, write to stderr. + c.TraceOn(os.Stderr) + defer c.TraceOff() + + for i, test := range tests { + bufSize := dataFileMap["datafile-10-kB"] + + // Save the data + objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "") + args["objectName"] = objectName + + cmpChecksum := func(got, want string) { + if want != got { + logError(testName, function, args, startTime, "", "checksum mismatch", fmt.Errorf("want %s, got %s", want, got)) + return + } + } + + meta := map[string]string{} + reader := getDataReader("datafile-10-kB") + b, err := io.ReadAll(reader) + if err != nil { + logError(testName, function, args, startTime, "", "Read failed", err) + return + } + + h := test.hasher + h.Reset() + h.Write(b) + meta[test.header] = base64.StdEncoding.EncodeToString(h.Sum(nil)) + args["metadata"] = meta + + resp, err := c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(b), int64(bufSize), minio.PutObjectOptions{ + DisableMultipart: true, + UserMetadata: nil, + DisableContentSha256: true, + SendContentMd5: false, + }) + if err == nil { + if i == 0 && resp.ChecksumCRC32C == "" { + ignoredLog(testName, function, args, startTime, "Checksums does not appear to be supported by backend").Info() + return + } + } else { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + cmpChecksum(resp.ChecksumSHA256, meta["x-amz-checksum-sha256"]) + cmpChecksum(resp.ChecksumSHA1, meta["x-amz-checksum-sha1"]) + cmpChecksum(resp.ChecksumCRC32, meta["x-amz-checksum-crc32"]) + cmpChecksum(resp.ChecksumCRC32C, meta["x-amz-checksum-crc32c"]) + + // Usually this will be the same as above, since we skip automatic checksum when SHA256 content is sent. + // When/if we add a checksum control to PutObjectOptions this will make more sense. + resp, err = c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(b), int64(bufSize), minio.PutObjectOptions{ + DisableMultipart: true, + UserMetadata: nil, + DisableContentSha256: false, + SendContentMd5: false, + }) + if err != nil { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + // The checksum will not be enabled on HTTP, since it uses SHA256 blocks. + if mustParseBool(os.Getenv(enableHTTPS)) { + cmpChecksum(resp.ChecksumSHA256, meta["x-amz-checksum-sha256"]) + cmpChecksum(resp.ChecksumSHA1, meta["x-amz-checksum-sha1"]) + cmpChecksum(resp.ChecksumCRC32, meta["x-amz-checksum-crc32"]) + cmpChecksum(resp.ChecksumCRC32C, meta["x-amz-checksum-crc32c"]) + } + + // Set SHA256 header manually + sh256 := sha256.Sum256(b) + meta = map[string]string{"x-amz-checksum-sha256": base64.StdEncoding.EncodeToString(sh256[:])} + args["metadata"] = meta + resp, err = c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(b), int64(bufSize), minio.PutObjectOptions{ + DisableMultipart: true, + UserMetadata: meta, + DisableContentSha256: true, + SendContentMd5: false, + }) + if err != nil { + logError(testName, function, args, startTime, "", "PutObject failed", err) + return + } + cmpChecksum(resp.ChecksumSHA256, meta["x-amz-checksum-sha256"]) + cmpChecksum(resp.ChecksumSHA1, meta["x-amz-checksum-sha1"]) + cmpChecksum(resp.ChecksumCRC32, meta["x-amz-checksum-crc32"]) + cmpChecksum(resp.ChecksumCRC32C, meta["x-amz-checksum-crc32c"]) + delete(args, "metadata") + } + + successLogger(testName, function, args, startTime).Info() +} + // Test PutObject using a large data to trigger multipart readat func testPutObjectWithMetadata() { // initialize logging params @@ -12576,6 +12939,8 @@ func main() { testRemoveObjectWithVersioning() testRemoveObjectsWithVersioning() testObjectTaggingWithVersioning() + testTrailingChecksums() + testPutObjectWithAutomaticChecksums() // SSE-C tests will only work over TLS connection. if tls { diff --git a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go index 34914490c..ffd251451 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go @@ -289,7 +289,7 @@ func signV4(req http.Request, accessKeyID, secretAccessKey, sessionToken, locati req.Header.Add("X-Amz-Trailer", strings.ToLower(k)) } - req.TransferEncoding = []string{"aws-chunked"} + req.Header.Set("Content-Encoding", "aws-chunked") req.Header.Set("x-amz-decoded-content-length", strconv.FormatInt(req.ContentLength, 10)) } diff --git a/vendor/github.com/minio/minio-go/v7/post-policy.go b/vendor/github.com/minio/minio-go/v7/post-policy.go index 31b340dcf..0191909bd 100644 --- a/vendor/github.com/minio/minio-go/v7/post-policy.go +++ b/vendor/github.com/minio/minio-go/v7/post-policy.go @@ -1,6 +1,6 @@ /* * MinIO Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 MinIO, Inc. + * Copyright 2015-2023 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,11 @@ package minio import ( "encoding/base64" "fmt" + "net/http" "strings" "time" + + "github.com/minio/minio-go/v7/pkg/encrypt" ) // expirationDateFormat date format for expiration key in json policy. @@ -258,6 +261,26 @@ func (p *PostPolicy) SetUserMetadata(key string, value string) error { return nil } +// SetChecksum sets the checksum of the request. +func (p *PostPolicy) SetChecksum(c Checksum) { + if c.IsSet() { + p.formData[amzChecksumAlgo] = c.Type.String() + p.formData[c.Type.Key()] = c.Encoded() + } +} + +// SetEncryption - sets encryption headers for POST API +func (p *PostPolicy) SetEncryption(sse encrypt.ServerSide) { + if sse == nil { + return + } + h := http.Header{} + sse.Marshal(h) + for k, v := range h { + p.formData[k] = v[0] + } +} + // SetUserData - Set user data as a key/value couple. // Can be retrieved through a HEAD request or an event. func (p *PostPolicy) SetUserData(key string, value string) error { diff --git a/vendor/github.com/minio/sha256-simd/cpuid_other.go b/vendor/github.com/minio/sha256-simd/cpuid_other.go index cd9fbf2d9..97af6a195 100644 --- a/vendor/github.com/minio/sha256-simd/cpuid_other.go +++ b/vendor/github.com/minio/sha256-simd/cpuid_other.go @@ -23,6 +23,11 @@ import ( "github.com/klauspost/cpuid/v2" ) +var ( + hasIntelSha = runtime.GOARCH == "amd64" && cpuid.CPU.Supports(cpuid.SHA, cpuid.SSSE3, cpuid.SSE4) + hasAvx512 = cpuid.CPU.Supports(cpuid.AVX512F, cpuid.AVX512DQ, cpuid.AVX512BW, cpuid.AVX512VL) +) + func hasArmSha2() bool { if cpuid.CPU.Has(cpuid.SHA2) { return true @@ -42,5 +47,4 @@ func hasArmSha2() bool { return false } return bytes.Contains(cpuInfo, []byte(sha256Feature)) - } diff --git a/vendor/github.com/minio/sha256-simd/sha256.go b/vendor/github.com/minio/sha256-simd/sha256.go index b137ead9f..f146bbdb5 100644 --- a/vendor/github.com/minio/sha256-simd/sha256.go +++ b/vendor/github.com/minio/sha256-simd/sha256.go @@ -19,10 +19,8 @@ package sha256 import ( "crypto/sha256" "encoding/binary" + "errors" "hash" - "runtime" - - "github.com/klauspost/cpuid/v2" ) // Size - The size of a SHA256 checksum in bytes. @@ -68,42 +66,34 @@ func (d *digest) Reset() { type blockfuncType int const ( - blockfuncGeneric blockfuncType = iota - blockfuncSha blockfuncType = iota - blockfuncArm blockfuncType = iota + blockfuncStdlib blockfuncType = iota + blockfuncIntelSha + blockfuncArmSha2 + blockfuncForceGeneric = -1 ) var blockfunc blockfuncType func init() { - blockfunc = blockfuncGeneric switch { - case hasSHAExtensions(): - blockfunc = blockfuncSha + case hasIntelSha: + blockfunc = blockfuncIntelSha case hasArmSha2(): - blockfunc = blockfuncArm - default: - blockfunc = blockfuncGeneric + blockfunc = blockfuncArmSha2 } } -var avx512 = cpuid.CPU.Supports(cpuid.AVX512F, cpuid.AVX512DQ, cpuid.AVX512BW, cpuid.AVX512VL) - -// hasSHAExtensions return whether the cpu supports SHA extensions. -func hasSHAExtensions() bool { - return cpuid.CPU.Supports(cpuid.SHA, cpuid.SSSE3, cpuid.SSE4) && runtime.GOARCH == "amd64" -} - // New returns a new hash.Hash computing the SHA256 checksum. func New() hash.Hash { - if blockfunc != blockfuncGeneric { - d := new(digest) - d.Reset() - return d + if blockfunc == blockfuncStdlib { + // Fallback to the standard golang implementation + // if no features were found. + return sha256.New() } - // Fallback to the standard golang implementation - // if no features were found. - return sha256.New() + + d := new(digest) + d.Reset() + return d } // Sum256 - single caller sha256 helper @@ -272,11 +262,11 @@ func (d *digest) checkSum() (digest [Size]byte) { } func block(dig *digest, p []byte) { - if blockfunc == blockfuncSha { - blockShaGo(dig, p) - } else if blockfunc == blockfuncArm { - blockArmGo(dig, p) - } else if blockfunc == blockfuncGeneric { + if blockfunc == blockfuncIntelSha { + blockIntelShaGo(dig, p) + } else if blockfunc == blockfuncArmSha2 { + blockArmSha2Go(dig, p) + } else { blockGeneric(dig, p) } } @@ -397,3 +387,82 @@ var _K = []uint32{ 0xbef9a3f7, 0xc67178f2, } + +const ( + magic256 = "sha\x03" + marshaledSize = len(magic256) + 8*4 + chunk + 8 +) + +func (d *digest) MarshalBinary() ([]byte, error) { + b := make([]byte, 0, marshaledSize) + b = append(b, magic256...) + b = appendUint32(b, d.h[0]) + b = appendUint32(b, d.h[1]) + b = appendUint32(b, d.h[2]) + b = appendUint32(b, d.h[3]) + b = appendUint32(b, d.h[4]) + b = appendUint32(b, d.h[5]) + b = appendUint32(b, d.h[6]) + b = appendUint32(b, d.h[7]) + b = append(b, d.x[:d.nx]...) + b = b[:len(b)+len(d.x)-d.nx] // already zero + b = appendUint64(b, d.len) + return b, nil +} + +func (d *digest) UnmarshalBinary(b []byte) error { + if len(b) < len(magic256) || string(b[:len(magic256)]) != magic256 { + return errors.New("crypto/sha256: invalid hash state identifier") + } + if len(b) != marshaledSize { + return errors.New("crypto/sha256: invalid hash state size") + } + b = b[len(magic256):] + b, d.h[0] = consumeUint32(b) + b, d.h[1] = consumeUint32(b) + b, d.h[2] = consumeUint32(b) + b, d.h[3] = consumeUint32(b) + b, d.h[4] = consumeUint32(b) + b, d.h[5] = consumeUint32(b) + b, d.h[6] = consumeUint32(b) + b, d.h[7] = consumeUint32(b) + b = b[copy(d.x[:], b):] + b, d.len = consumeUint64(b) + d.nx = int(d.len % chunk) + return nil +} + +func appendUint32(b []byte, v uint32) []byte { + return append(b, + byte(v>>24), + byte(v>>16), + byte(v>>8), + byte(v), + ) +} + +func appendUint64(b []byte, v uint64) []byte { + return append(b, + byte(v>>56), + byte(v>>48), + byte(v>>40), + byte(v>>32), + byte(v>>24), + byte(v>>16), + byte(v>>8), + byte(v), + ) +} + +func consumeUint64(b []byte) ([]byte, uint64) { + _ = b[7] + x := uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | + uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56 + return b[8:], x +} + +func consumeUint32(b []byte) ([]byte, uint32) { + _ = b[3] + x := uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24 + return b[4:], x +} diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go index b7d7c1637..4b9473a4e 100644 --- a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go +++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go @@ -1,4 +1,5 @@ -//+build !noasm,!appengine,gc +//go:build !noasm && !appengine && gc +// +build !noasm,!appengine,gc /* * Minio Cloud Storage, (C) 2017 Minio, Inc. diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s index 275bcacbc..cca534e46 100644 --- a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s +++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s @@ -1,4 +1,4 @@ -//+build !noasm,!appengine +//+build !noasm,!appengine,gc TEXT ·sha256X16Avx512(SB), 7, $0 MOVQ digests+0(FP), DI diff --git a/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.go deleted file mode 100644 index bef949419..000000000 --- a/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.go +++ /dev/null @@ -1,6 +0,0 @@ -//+build !noasm,!appengine,gc - -package sha256 - -//go:noescape -func blockSha(h *[8]uint32, message []uint8) diff --git a/vendor/github.com/minio/sha256-simd/sha256block_amd64.go b/vendor/github.com/minio/sha256-simd/sha256block_amd64.go index 0c48d45f8..e536f54e1 100644 --- a/vendor/github.com/minio/sha256-simd/sha256block_amd64.go +++ b/vendor/github.com/minio/sha256-simd/sha256block_amd64.go @@ -1,4 +1,5 @@ -//+build !noasm,!appengine,gc +//go:build !noasm && !appengine && gc +// +build !noasm,!appengine,gc /* * Minio Cloud Storage, (C) 2016 Minio, Inc. @@ -18,10 +19,13 @@ package sha256 -func blockArmGo(dig *digest, p []byte) { - panic("blockArmGo called unexpectedly") +func blockArmSha2Go(dig *digest, p []byte) { + panic("blockArmSha2Go called unexpectedly") } -func blockShaGo(dig *digest, p []byte) { - blockSha(&dig.h, p) +//go:noescape +func blockIntelSha(h *[8]uint32, message []uint8) + +func blockIntelShaGo(dig *digest, p []byte) { + blockIntelSha(&dig.h, p) } diff --git a/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.s b/vendor/github.com/minio/sha256-simd/sha256block_amd64.s similarity index 99% rename from vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.s rename to vendor/github.com/minio/sha256-simd/sha256block_amd64.s index 909fc0ef8..c98a1d8f0 100644 --- a/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.s +++ b/vendor/github.com/minio/sha256-simd/sha256block_amd64.s @@ -1,4 +1,4 @@ -//+build !noasm,!appengine +//+build !noasm,!appengine,gc // SHA intrinsic version of SHA256 @@ -106,7 +106,7 @@ GLOBL SHUF_MASK<>(SB), RODATA|NOPTR, $16 // X13 saved hash state // CDGH // X15 data shuffle mask (constant) -TEXT ·blockSha(SB), NOSPLIT, $0-32 +TEXT ·blockIntelSha(SB), NOSPLIT, $0-32 MOVQ h+0(FP), DX MOVQ message_base+8(FP), SI MOVQ message_len+16(FP), DI diff --git a/vendor/github.com/minio/sha256-simd/sha256block_arm64.go b/vendor/github.com/minio/sha256-simd/sha256block_arm64.go index 58ccf6eb5..d4369e24a 100644 --- a/vendor/github.com/minio/sha256-simd/sha256block_arm64.go +++ b/vendor/github.com/minio/sha256-simd/sha256block_arm64.go @@ -1,4 +1,5 @@ -//+build !noasm,!appengine,gc +//go:build !noasm && !appengine && gc +// +build !noasm,!appengine,gc /* * Minio Cloud Storage, (C) 2016 Minio, Inc. @@ -18,18 +19,18 @@ package sha256 -func blockShaGo(dig *digest, p []byte) { - panic("blockShaGoc called unexpectedly") +func blockIntelShaGo(dig *digest, p []byte) { + panic("blockIntelShaGo called unexpectedly") } //go:noescape -func blockArm(h []uint32, message []uint8) +func blockArmSha2(h []uint32, message []uint8) -func blockArmGo(dig *digest, p []byte) { +func blockArmSha2Go(dig *digest, p []byte) { h := []uint32{dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7]} - blockArm(h[:], p[:]) + blockArmSha2(h[:], p[:]) dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7] diff --git a/vendor/github.com/minio/sha256-simd/sha256block_arm64.s b/vendor/github.com/minio/sha256-simd/sha256block_arm64.s index c6ddb3717..7ab88b163 100644 --- a/vendor/github.com/minio/sha256-simd/sha256block_arm64.s +++ b/vendor/github.com/minio/sha256-simd/sha256block_arm64.s @@ -1,4 +1,4 @@ -//+build !noasm,!appengine +//+build !noasm,!appengine,gc // ARM64 version of SHA256 @@ -25,7 +25,7 @@ // their Plan9 equivalents // -TEXT ·blockArm(SB), 7, $0 +TEXT ·blockArmSha2(SB), 7, $0 MOVD h+0(FP), R0 MOVD message+24(FP), R1 MOVD message_len+32(FP), R2 // length of message diff --git a/vendor/github.com/minio/sha256-simd/sha256block_other.go b/vendor/github.com/minio/sha256-simd/sha256block_other.go index ec586c060..94d7eb0b4 100644 --- a/vendor/github.com/minio/sha256-simd/sha256block_other.go +++ b/vendor/github.com/minio/sha256-simd/sha256block_other.go @@ -1,4 +1,5 @@ -//+build appengine noasm !amd64,!arm64 !gc +//go:build appengine || noasm || (!amd64 && !arm64) || !gc +// +build appengine noasm !amd64,!arm64 !gc /* * Minio Cloud Storage, (C) 2019 Minio, Inc. @@ -18,11 +19,11 @@ package sha256 -func blockShaGo(dig *digest, p []byte) { - panic("blockShaGo called unexpectedly") +func blockIntelShaGo(dig *digest, p []byte) { + panic("blockIntelShaGo called unexpectedly") } -func blockArmGo(dig *digest, p []byte) { - panic("blockArmGo called unexpectedly") +func blockArmSha2Go(dig *digest, p []byte) { + panic("blockArmSha2Go called unexpectedly") } diff --git a/vendor/github.com/rs/xid/.golangci.yml b/vendor/github.com/rs/xid/.golangci.yml new file mode 100644 index 000000000..7929600a9 --- /dev/null +++ b/vendor/github.com/rs/xid/.golangci.yml @@ -0,0 +1,5 @@ +run: + tests: false + +output: + sort-results: true diff --git a/vendor/github.com/rs/xid/README.md b/vendor/github.com/rs/xid/README.md index 5bf462e83..974e67d29 100644 --- a/vendor/github.com/rs/xid/README.md +++ b/vendor/github.com/rs/xid/README.md @@ -70,6 +70,9 @@ References: - Ruby port by [Valar](https://github.com/valarpirai/): https://github.com/valarpirai/ruby_xid - Java port by [0xShamil](https://github.com/0xShamil/): https://github.com/0xShamil/java-xid - Dart port by [Peter Bwire](https://github.com/pitabwire): https://pub.dev/packages/xid +- PostgreSQL port by [Rasmus Holm](https://github.com/crholm): https://github.com/modfin/pg-xid +- Swift port by [Uditha Atukorala](https://github.com/uditha-atukorala): https://github.com/uditha-atukorala/swift-xid +- C++ port by [Uditha Atukorala](https://github.com/uditha-atukorala): https://github.com/uditha-atukorala/libxid ## Install diff --git a/vendor/github.com/rs/xid/id.go b/vendor/github.com/rs/xid/id.go index 1f536b415..fcd7a0413 100644 --- a/vendor/github.com/rs/xid/id.go +++ b/vendor/github.com/rs/xid/id.go @@ -43,7 +43,7 @@ package xid import ( "bytes" - "crypto/md5" + "crypto/sha256" "crypto/rand" "database/sql/driver" "encoding/binary" @@ -72,13 +72,11 @@ const ( ) var ( - // objectIDCounter is atomically incremented when generating a new ObjectId - // using NewObjectId() function. It's used as a counter part of an id. - // This id is initialized with a random value. + // objectIDCounter is atomically incremented when generating a new ObjectId. It's + // used as the counter part of an id. This id is initialized with a random value. objectIDCounter = randInt() - // machineId stores machine id generated once and used in subsequent calls - // to NewObjectId function. + // machineID is generated once and used in subsequent calls to the New* functions. machineID = readMachineID() // pid stores the current process id @@ -107,9 +105,9 @@ func init() { } } -// readMachineId generates machine id and puts it into the machineId global -// variable. If this function fails to get the hostname, it will cause -// a runtime error. +// readMachineID generates a machine ID, derived from a platform-specific machine ID +// value, or else the machine's hostname, or else a randomly-generated number. +// It panics if all of these methods fail. func readMachineID() []byte { id := make([]byte, 3) hid, err := readPlatformMachineID() @@ -117,7 +115,7 @@ func readMachineID() []byte { hid, err = os.Hostname() } if err == nil && len(hid) != 0 { - hw := md5.New() + hw := sha256.New() hw.Write([]byte(hid)) copy(id, hw.Sum(nil)) } else { @@ -148,7 +146,7 @@ func NewWithTime(t time.Time) ID { var id ID // Timestamp, 4 bytes, big endian binary.BigEndian.PutUint32(id[:], uint32(t.Unix())) - // Machine, first 3 bytes of md5(hostname) + // Machine ID, 3 bytes id[4] = machineID[0] id[5] = machineID[1] id[6] = machineID[2] @@ -239,6 +237,7 @@ func (id *ID) UnmarshalText(text []byte) error { } } if !decode(id, text) { + *id = nilID return ErrInvalidID } return nil @@ -264,6 +263,10 @@ func decode(id *ID, src []byte) bool { _ = id[11] id[11] = dec[src[17]]<<6 | dec[src[18]]<<1 | dec[src[19]]>>4 + // check the last byte + if encoding[(id[11]<<4)&0x1F] != src[19] { + return false + } id[10] = dec[src[16]]<<3 | dec[src[17]]>>2 id[9] = dec[src[14]]<<5 | dec[src[15]] id[8] = dec[src[12]]<<7 | dec[src[13]]<<2 | dec[src[14]]>>3 @@ -275,16 +278,7 @@ func decode(id *ID, src []byte) bool { id[2] = dec[src[3]]<<4 | dec[src[4]]>>1 id[1] = dec[src[1]]<<6 | dec[src[2]]<<1 | dec[src[3]]>>4 id[0] = dec[src[0]]<<3 | dec[src[1]]>>2 - - // Validate that there are no discarer bits (padding) in src that would - // cause the string-encoded id not to equal src. - var check [4]byte - - check[3] = encoding[(id[11]<<4)&0x1F] - check[2] = encoding[(id[11]>>1)&0x1F] - check[1] = encoding[(id[11]>>6)&0x1F|(id[10]<<2)&0x1F] - check[0] = encoding[id[10]>>3] - return bytes.Equal([]byte(src[16:20]), check[:]) + return true } // Time returns the timestamp part of the id. @@ -344,6 +338,11 @@ func (id ID) IsNil() bool { return id == nilID } +// Alias of IsNil +func (id ID) IsZero() bool { + return id.IsNil() +} + // NilID returns a zero value for `xid.ID`. func NilID() ID { return nilID diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md index b042c896f..d1d4a85fd 100644 --- a/vendor/github.com/sirupsen/logrus/README.md +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -9,7 +9,7 @@ the last thing you want from your Logging library (again...). This does not mean Logrus is dead. Logrus will continue to be maintained for security, (backwards compatible) bug fixes, and performance (where we are -limited by the interface). +limited by the interface). I believe Logrus' biggest contribution is to have played a part in today's widespread use of structured logging in Golang. There doesn't seem to be a @@ -43,7 +43,7 @@ plain text): With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash or Splunk: -```json +```text {"animal":"walrus","level":"info","msg":"A group of walrus emerges from the ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} @@ -99,7 +99,7 @@ time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcr ``` Note that this does add measurable overhead - the cost will depend on the version of Go, but is between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your -environment via benchmarks: +environment via benchmarks: ``` go test -bench=.*CallerTracing ``` @@ -317,6 +317,8 @@ log.SetLevel(log.InfoLevel) It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose environment if your application has that. +Note: If you want different log levels for global (`log.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging). + #### Entries Besides the fields added with `WithField` or `WithFields` some fields are diff --git a/vendor/modules.txt b/vendor/modules.txt index 7e6615e0f..b1501544e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -355,7 +355,7 @@ github.com/json-iterator/go # github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 ## explicit github.com/kballard/go-shellquote -# github.com/klauspost/compress v1.16.3 +# github.com/klauspost/compress v1.16.5 ## explicit; go 1.18 github.com/klauspost/compress/flate github.com/klauspost/compress/gzip @@ -384,7 +384,7 @@ github.com/miekg/dns # github.com/minio/md5-simd v1.1.2 ## explicit; go 1.14 github.com/minio/md5-simd -# github.com/minio/minio-go/v7 v7.0.53 +# github.com/minio/minio-go/v7 v7.0.55 ## explicit; go 1.17 github.com/minio/minio-go/v7 github.com/minio/minio-go/v7/pkg/credentials @@ -397,8 +397,8 @@ github.com/minio/minio-go/v7/pkg/set github.com/minio/minio-go/v7/pkg/signer github.com/minio/minio-go/v7/pkg/sse github.com/minio/minio-go/v7/pkg/tags -# github.com/minio/sha256-simd v1.0.0 -## explicit; go 1.13 +# github.com/minio/sha256-simd v1.0.1 +## explicit; go 1.17 github.com/minio/sha256-simd # github.com/mitchellh/mapstructure v1.5.0 ## explicit; go 1.14 @@ -434,10 +434,10 @@ github.com/quasoft/memstore # github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec ## explicit; go 1.12 github.com/remyoudompheng/bigfft -# github.com/rs/xid v1.4.0 +# github.com/rs/xid v1.5.0 ## explicit; go 1.12 github.com/rs/xid -# github.com/sirupsen/logrus v1.9.0 +# github.com/sirupsen/logrus v1.9.2 ## explicit; go 1.13 github.com/sirupsen/logrus # github.com/spf13/afero v1.9.3