summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/klauspost/compress/s2/encode_amd64.go
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2022-01-18 20:24:14 +0100
committerGitHub <noreply@github.com>2022-01-18 20:24:14 +0100
commitaad60c882e16cd2c8769a49e6d9f87a040590d62 (patch)
tree3bfe1f8953b40f9beb39c69db3a7647ea6de54d2 /vendor/github.com/klauspost/compress/s2/encode_amd64.go
parentfecca575078a21dedb0cab213dde7fd97161c0fa (diff)
downloadmatterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.tar.gz
matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.tar.bz2
matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.zip
Bump github.com/mattermost/mattermost-server/v6 from 6.1.0 to 6.3.0 (#1686)
Bumps [github.com/mattermost/mattermost-server/v6](https://github.com/mattermost/mattermost-server) from 6.1.0 to 6.3.0. - [Release notes](https://github.com/mattermost/mattermost-server/releases) - [Changelog](https://github.com/mattermost/mattermost-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/mattermost/mattermost-server/compare/v6.1.0...v6.3.0) --- updated-dependencies: - dependency-name: github.com/mattermost/mattermost-server/v6 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/s2/encode_amd64.go')
-rw-r--r--vendor/github.com/klauspost/compress/s2/encode_amd64.go142
1 files changed, 142 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/s2/encode_amd64.go b/vendor/github.com/klauspost/compress/s2/encode_amd64.go
new file mode 100644
index 00000000..e612225f
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/s2/encode_amd64.go
@@ -0,0 +1,142 @@
+//go:build !appengine && !noasm && gc
+// +build !appengine,!noasm,gc
+
+package s2
+
+// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It
+// assumes that the varint-encoded length of the decompressed bytes has already
+// been written.
+//
+// It also assumes that:
+// len(dst) >= MaxEncodedLen(len(src)) &&
+// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
+func encodeBlock(dst, src []byte) (d int) {
+ const (
+ // Use 12 bit table when less than...
+ limit12B = 16 << 10
+ // Use 10 bit table when less than...
+ limit10B = 4 << 10
+ // Use 8 bit table when less than...
+ limit8B = 512
+ )
+
+ if len(src) >= 4<<20 {
+ return encodeBlockAsm(dst, src)
+ }
+ if len(src) >= limit12B {
+ return encodeBlockAsm4MB(dst, src)
+ }
+ if len(src) >= limit10B {
+ return encodeBlockAsm12B(dst, src)
+ }
+ if len(src) >= limit8B {
+ return encodeBlockAsm10B(dst, src)
+ }
+ if len(src) < minNonLiteralBlockSize {
+ return 0
+ }
+ return encodeBlockAsm8B(dst, src)
+}
+
+// encodeBlockBetter encodes a non-empty src to a guaranteed-large-enough dst. It
+// assumes that the varint-encoded length of the decompressed bytes has already
+// been written.
+//
+// It also assumes that:
+// len(dst) >= MaxEncodedLen(len(src)) &&
+// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
+func encodeBlockBetter(dst, src []byte) (d int) {
+ const (
+ // Use 12 bit table when less than...
+ limit12B = 16 << 10
+ // Use 10 bit table when less than...
+ limit10B = 4 << 10
+ // Use 8 bit table when less than...
+ limit8B = 512
+ )
+
+ if len(src) > 4<<20 {
+ return encodeBetterBlockAsm(dst, src)
+ }
+ if len(src) >= limit12B {
+ return encodeBetterBlockAsm4MB(dst, src)
+ }
+ if len(src) >= limit10B {
+ return encodeBetterBlockAsm12B(dst, src)
+ }
+ if len(src) >= limit8B {
+ return encodeBetterBlockAsm10B(dst, src)
+ }
+ if len(src) < minNonLiteralBlockSize {
+ return 0
+ }
+ return encodeBetterBlockAsm8B(dst, src)
+}
+
+// encodeBlockSnappy encodes a non-empty src to a guaranteed-large-enough dst. It
+// assumes that the varint-encoded length of the decompressed bytes has already
+// been written.
+//
+// It also assumes that:
+// len(dst) >= MaxEncodedLen(len(src)) &&
+// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
+func encodeBlockSnappy(dst, src []byte) (d int) {
+ const (
+ // Use 12 bit table when less than...
+ limit12B = 16 << 10
+ // Use 10 bit table when less than...
+ limit10B = 4 << 10
+ // Use 8 bit table when less than...
+ limit8B = 512
+ )
+ if len(src) >= 64<<10 {
+ return encodeSnappyBlockAsm(dst, src)
+ }
+ if len(src) >= limit12B {
+ return encodeSnappyBlockAsm64K(dst, src)
+ }
+ if len(src) >= limit10B {
+ return encodeSnappyBlockAsm12B(dst, src)
+ }
+ if len(src) >= limit8B {
+ return encodeSnappyBlockAsm10B(dst, src)
+ }
+ if len(src) < minNonLiteralBlockSize {
+ return 0
+ }
+ return encodeSnappyBlockAsm8B(dst, src)
+}
+
+// encodeBlockSnappy encodes a non-empty src to a guaranteed-large-enough dst. It
+// assumes that the varint-encoded length of the decompressed bytes has already
+// been written.
+//
+// It also assumes that:
+// len(dst) >= MaxEncodedLen(len(src)) &&
+// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
+func encodeBlockBetterSnappy(dst, src []byte) (d int) {
+ const (
+ // Use 12 bit table when less than...
+ limit12B = 16 << 10
+ // Use 10 bit table when less than...
+ limit10B = 4 << 10
+ // Use 8 bit table when less than...
+ limit8B = 512
+ )
+ if len(src) >= 64<<10 {
+ return encodeSnappyBetterBlockAsm(dst, src)
+ }
+ if len(src) >= limit12B {
+ return encodeSnappyBetterBlockAsm64K(dst, src)
+ }
+ if len(src) >= limit10B {
+ return encodeSnappyBetterBlockAsm12B(dst, src)
+ }
+ if len(src) >= limit8B {
+ return encodeSnappyBetterBlockAsm10B(dst, src)
+ }
+ if len(src) < minNonLiteralBlockSize {
+ return 0
+ }
+ return encodeSnappyBetterBlockAsm8B(dst, src)
+}